上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 182 下一页
摘要: 简单并查集View Code #include <iostream>#include <cstdlib>#include <cstdio>#include <cstring>using namespace std;#define maxn 30005int n, m;int father[maxn];int stk[maxn];void init(){ for (int i = 0; i < n; i++) father[i] = i;}int getanc(int a){ int top = 0; while (father[a] != 阅读全文
posted @ 2013-04-16 18:41 undefined2024 阅读(320) 评论(0) 推荐(1)
摘要: 简单模拟View Code //zoj1764#include <iostream>#include <string>using namespace std;int n, winprob, winpoint, nowprob, nowpoint;string winname, nowname;int main(){ int i, a, b, j; // freopen("t.txt", "r", stdin); cin >> n; winprob = -1; for (i = 0; i < n; i++) { . 阅读全文
posted @ 2013-04-09 14:19 undefined2024 阅读(181) 评论(0) 推荐(0)
摘要: 简单题View Code #include <iostream>#include <cstdlib>#include <cstdio>#include <cstring>using namespace std;int main(){ //freopen("t.txt", "r", stdin); double n, m; scanf("%lf", &m); while (scanf("%lf", &n), n != 999) { printf(&quo 阅读全文
posted @ 2013-04-09 14:17 undefined2024 阅读(172) 评论(0) 推荐(0)
摘要: 麻烦的字符串处理View Code //zoj1762//注意题意,是按挑战名单的列,逐列进行从上至下的输入#include <iostream>#include <string>using namespace std;const int maxn = 35;int n, fact2[11], roundnum, longest[11], linenum, t;string input[maxn / 2][2];string list[maxn * 4];char output[maxn][maxn * 8];int start... 阅读全文
posted @ 2013-04-09 14:02 undefined2024 阅读(187) 评论(0) 推荐(0)
摘要: 简单题View Code #include <iostream>#include <cstdlib>#include <cstdio>#include <cstring>using namespace std;#define maxn 20int n;int f[maxn];void input(){ n = 0; while (scanf("%d", &f[n]), f[n]) { if (f[n] == -1) exit(0); n++; }}void work(){ int ans = 0; for (... 阅读全文
posted @ 2013-04-03 17:02 undefined2024 阅读(440) 评论(0) 推荐(0)
上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 182 下一页