摘要:
注意这题算的是累计分数的排名,用map做View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>#include <map>using namespace std;#define maxn 10006char li[40];int n, m;string name[maxn];map <string, int> score;int main(){ //freopen("t.txt", " 阅读全文
posted @ 2011-06-02 12:14
undefined2024
阅读(315)
评论(0)
推荐(0)
摘要:
简单题View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>using namespace std;char f[30];char st[100];int main(){ //freopen("t.txt", "r", stdin); gets(f); gets(st); for (int i = 0; i < strlen(st); i++) { if (st[i] <='Z& 阅读全文
posted @ 2011-06-02 11:43
undefined2024
阅读(190)
评论(0)
推荐(0)
摘要:
简单题View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>using namespace std;int f[30];int find(int top, int pos){ while (f[pos] < top && pos < 26) pos++; if (pos == 26) return -1; return pos;}int main(){ //freopen("t.txt", 阅读全文
posted @ 2011-06-02 11:35
undefined2024
阅读(276)
评论(0)
推荐(0)
摘要:
题意:for(int i = a; i != b; i = (i + c) % (2 ^ k)) 能运行多少次。分析:多次错的原因是1<<k,k很大会超出int;扩展欧几里德,是求x * a + y * b = gcd(a, b) 的整数解。这题我们可以认为是在mod 2 ^k 的条件下,c * x = b - a; 求 x。当然我们也可以直接理解为本题是求 c * x + 2 ^ k * y = b - a;先求c * x1 + 2 ^ k * y1 = gcd(c, 2 ^ k);两端同乘(b - a) / gcd(c, 2 ^ k)即可变为原式整理x的范围,输出即可View 阅读全文
posted @ 2011-06-02 11:04
undefined2024
阅读(965)
评论(0)
推荐(0)
摘要:
二分加网络流,开始虽然写了floyd,但是没有调用,导致错了许多次。View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>using namespace std;#define N 300#define inf 10000000struct Edge{ int x, y, nxt; int c;} bf[N * N];int k, c, m, n, s, t;int map[N][N];int ne, head[N], cur[N], p 阅读全文
posted @ 2011-06-02 09:18
undefined2024
阅读(398)
评论(0)
推荐(0)