上一页 1 2 3 4 5 6 7 8 9 ··· 50 下一页
摘要: http://poj.org/problem?id=3061 1 #include <iostream> 2 #include <cstring> 3 #include <cmath> 4 #include <cstdio> 5 #include <algorithm> 6 using namesp 阅读全文
posted @ 2017-12-02 21:17 yijiull 阅读(151) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=2154 long long 超时, int 过了。。。 1 #include <iostream> 2 #include <cstring> 3 #include <cmath> 4 #include <cstdio> 5 #include <a 阅读全文
posted @ 2017-12-02 20:48 yijiull 阅读(119) 评论(0) 推荐(0) 编辑
摘要: Benefit UVA - 11889 题意: 给出a和c, 让求最小的b使得lcm(a, b) == c. 1 #include <bits/stdc++.h> 2 using namespace std; 3 4 int gcd(int a, int b){ 5 return b == 0 ? 阅读全文
posted @ 2017-12-02 17:20 yijiull 阅读(170) 评论(0) 推荐(0) 编辑
摘要: Alphabet Soup HDU - 4187 题意:在圆上给m个点,告诉你角度,现在有n种颜色,问有多少种涂色方案。 和典型的项链那道题相比,唯一附加的条件就是角度。 于是,我们可以求得角度差的循环节的长度,然后每次旋转的限制是:必须旋转循环节长度的倍数。 求循环节长度用kmp的fail数组, 阅读全文
posted @ 2017-12-02 16:34 yijiull 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 17青岛现场赛polya计数 转自https://www.cnblogs.com/Just--Do--It/p/7806923.html 1 #include <bits/stdc++.h> 2 using namespace std; 3 #define LL long long 4 #defin 阅读全文
posted @ 2017-11-27 22:43 yijiull 阅读(301) 评论(0) 推荐(0) 编辑
摘要: 上下界网络流 链接 转自:http://blog.csdn.net/leolin_/article/details/7208246 一、有源汇、无源汇的可行流。 求可行流,其实就是问是否存在一个方案可以使所有必须边都满流。对于有源汇的网络,我们可以添加一条边t->s,流量上限为INF,这样就变成了无 阅读全文
posted @ 2017-11-22 19:48 yijiull 阅读(125) 评论(0) 推荐(0) 编辑
摘要: RevolC FaeLoN UVA - 10972 题意:给一个无向图,现在要将所有的边变成有向,问至少还需要建几条边才能使得图强连通。 新的有向图强连通等价于原图边双连通。 1 /*********************************************************** 阅读全文
posted @ 2017-11-19 21:48 yijiull 阅读(143) 评论(0) 推荐(0) 编辑
摘要: Street Directions UVA - 610 题意:给一个无重边的无向图,把边变成有向的,有的边可能需要变成两条有向边,使得从任何一点出发都可以到达其他所有点。 只有桥需要变成两条边,其它边dfs输出即可。 1 /************************************** 阅读全文
posted @ 2017-11-19 20:43 yijiull 阅读(139) 评论(0) 推荐(0) 编辑
摘要: Organising the Organisation UVA - 10766 生成树计数 要用到Matric-Tree定理。 1 #include <bits/stdc++.h> 2 using namespace std; 3 #define LL long long 4 const int m 阅读全文
posted @ 2017-11-19 16:51 yijiull 阅读(191) 评论(0) 推荐(0) 编辑
摘要: Educational Codeforces Round 32 A. Local Extrema 直接模拟一下~ B. Buggy Robot x和y轴无关,分别考虑即可 C. K-Dominant Character 想到了做法,但是没过。。。 就是记录一下相同字母的最大间距,然后取最小的即可~ 阅读全文
posted @ 2017-11-11 00:46 yijiull 阅读(170) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 50 下一页