题目链接:http://acm.split.hdu.edu.cn/showproblem.php?pid=5876 题意:有一个含有n个点的无向图,已知图的补图含有m条边u, v;求在原图中,起点s到其他n-1个点的最短距离,默认边的距离为1; 由于点的个数较大,不能建原图,只能从补图入手;从起点s Read More
posted @ 2016-09-15 18:56 西瓜不懂柠檬的酸 Views(162) Comments(0) Diggs(0)
题目链接:http://acm.split.hdu.edu.cn/showproblem.php?pid=5875 题意:有n个数,m个查询,每个查询有一个区间[L, R], 求ans, ans = a[L]%a[L+1]%a[L+2]%...%a[R]; 方法一:算是暴力吧,只能说数据太水; 用p Read More
posted @ 2016-09-15 15:51 西瓜不懂柠檬的酸 Views(204) Comments(0) Diggs(0)
题目链接:http://acm.split.hdu.edu.cn/showproblem.php?pid=5877 题意:给你一颗树,有n个节点,每个节点都有一个权值v[i];现在求有多少对(u,v)满足u是v的祖先,并且au*av<=k, k是已知的; 思路:从根节点开始dfs遍历整棵树,当遍历到 Read More
posted @ 2016-09-15 14:46 西瓜不懂柠檬的酸 Views(228) Comments(0) Diggs(0)
levels of contents