上一页 1 2 3 4 5 6 7 8 9 ··· 20 下一页
摘要: 中文题 题意就不说了,注意题目里说的是所有的人等级差不能超过一个值,而不是两个两个之间不能超过(这里题意搞错了wa半天),建好图,枚举可以在这个最短路里的最高级和最低级再跑最短路 得到最小值就可以了。 1 #include 2 #include 3 #include 4 #include ... 阅读全文
posted @ 2014-08-15 19:23 galaxy77 阅读(113) 评论(0) 推荐(0) 编辑
摘要: 打算这几天搞2-sat了,好好看看这几个博客 再刷十来个题目 gogo!!http://blog.csdn.net/jarjingx/article/details/8521690坑在这里,好好填吧!poj 3207poj 3683poj 3678poj 3648poj 2723poj 2749 阅读全文
posted @ 2014-08-12 20:37 galaxy77 阅读(104) 评论(0) 推荐(0) 编辑
摘要: 【题意】n*m的土地里每个格子里可以种树或者施肥,每一棵树开始可以结一颗果子,他的前后左右四个格子,若施了肥就可以让他结的果翻一倍,求最多可以得到多少果子。在每个(i+j)%2==0 的格子上种树 其他的施肥就可以了。 1 #include 2 #include 3 #include 4 using... 阅读全文
posted @ 2014-08-08 15:07 galaxy77 阅读(218) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=4927【解法】:最后的结果是C(n-1,0)*a[n] -C(n-1, 1) * a[n-1] ……C(n-1,n-1)*a[1]。符号位一正一负交替。 因为n有3000 之大,算C(n,i)时要用到大数... 阅读全文
posted @ 2014-08-08 14:37 galaxy77 阅读(199) 评论(0) 推荐(0) 编辑
摘要: 【题意】:n个重量为1~n的球,给定一些球之间的重量比较关系(如 2 1 表示第二个球比第一个球轻),求每个球可能的重量,ans[i] 表示第i个球的重量,要求输出的是ans字典序最小的情况。【思路】:对于给出的a b 建反边,每次 在出度为0的所有点里选一个序号最小的赋值(从n开始 由大到小赋)。... 阅读全文
posted @ 2014-08-06 16:22 galaxy77 阅读(149) 评论(0) 推荐(0) 编辑
摘要: 【题意】:求两个矩阵相乘的结果 1 #include 2 #include 3 #include 4 using namespace std; 5 #define mod 3 6 7 int a[808][802],b[808][802]; 8 int c[808][808],n; 9 10 vo... 阅读全文
posted @ 2014-08-06 15:43 galaxy77 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 【题意】:给你一个n*m的矩阵,填充着0-9的数字,每次能从一个点出发,到它的右边或者下边的点,花费为|x1-x2|+|y1-y2|-1, 如果跳跃的起点和终点的数字相同,则获得这个数字的收益,不能走已经走过的点 有K次重新选择起点的机会 如果可以走遍所有点,... 阅读全文
posted @ 2014-08-06 10:32 galaxy77 阅读(224) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 #define maxx 44 8 #define maxx2 44*44 9 #define INF 99999999... 阅读全文
posted @ 2014-07-31 19:28 galaxy77 阅读(191) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #define maxx 100010 10 using namespace std; 11 #de... 阅读全文
posted @ 2014-07-30 16:19 galaxy77 阅读(201) 评论(0) 推荐(0) 编辑
摘要: 【题意】:给出一张无向连通图,求添加多少条边可以成为边-双连通图【思路】:同3352 一样,求出边-双连通分量,缩点就成了一棵树,求这棵树里的出度为1 的点num 结果是(num-1)/2; 但是!! 这里和3352 哟一点不一样就是这里有重边,当有重边的时候,不同low值的两点可能属于... 阅读全文
posted @ 2014-07-29 10:55 galaxy77 阅读(270) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 20 下一页