摘要:#include <iostream> #include <stdlib.h> using namespace std; typedef struct node { int key, bf; struct node *lchild, *rchild; }*bnode; void rrotate(bn
阅读全文
摘要:#include <iostream> using namespace std; int main() { int n; scanf("%d", &n); long long a, b, c, res; int i, flag; for(i = 1; i <= n; i++) { scanf("%l
阅读全文
摘要:#include <iostream> #include <algorithm> #include <queue> using namespace std; struct node { int lchild, rchild, key; }tree[1010]; int num[1010], r =
阅读全文
摘要:#include <iostream> #include <set> using namespace std; int main() { int n; scanf("%d", &n); int i, k, j, next; set<int> s[60]; for(i = 1; i <= n; i++
阅读全文
摘要:#include <iostream> #include <vector> #include <algorithm> using namespace std; struct node { int ID_Number, Virtue_Grade, Talent_Grade, total; }; int
阅读全文
摘要:#include <iostream> #include <string.h> using namespace std; int main() { char s[4][70]; int i, len[4]; for(i = 0; i < 4; i++) { gets(s[i]); len[i] =
阅读全文
摘要:#include <iostream> #include <string.h> using namespace std; struct node { int d; char s[110]; }; int n; node getnode(char s[]) { int firstpos = -1, p
阅读全文
摘要:#include <iostream> #include <math.h> using namespace std; int judge(long int n) { long int i, r = sqrt(n * 1.0); for(i = 2; i <= r; i++) { if(n % i =
阅读全文
摘要:#include <iostream> using namespace std; int main() { int a[3], b[3]; scanf("%d.%d.%d %d.%d.%d", &a[0], &a[1], &a[2], &b[0], &b[1], &b[2]); int add; a
阅读全文
摘要:#include <iostream> #include <stack> using namespace std; int c[100010]; int lowbit(int x) { return x & (-x); } int getsum(int x) { int sum = 0; while
阅读全文
摘要:#include <iostream> #include <vector> using namespace std; int main() { int np, ng; scanf("%d%d", &np, &ng); int weight[1010], i; for(i = 0; i < np; i
阅读全文
摘要:#include <iostream> #include <string.h> #include <vector> #include <algorithm> using namespace std; struct node { char name[10]; int age, worth; }; in
阅读全文
摘要:#include <iostream> using namespace std; int c[100000000]; int main() { int m, n; scanf("%d%d", &m, &n); int i, j, num, max = 0, res; for(i = 0; i < n
阅读全文
摘要:#include <iostream> #include <vector> #include <algorithm> using namespace std; int s, w[110], vis[110]; vector<int> v[110], path; void printpath() {
阅读全文
摘要:#include <iostream> #include <algorithm> #include <vector> using namespace std; struct node { int address, key, next; }nod[100000]; int cmp(node n1, n
阅读全文
摘要:#include <iostream> #include <stack> using namespace std; int main() { int m, n, k; scanf("%d%d%d", &m, &n, &k); int i, num[1010], j, index, flag, beg
阅读全文
摘要:#include <iostream> using namespace std; int main() { int n; scanf("%d", &n); int low, mid, high, d = 1, res = 0; while(n >= d) { high = n / (d * 10);
阅读全文
摘要:#include <iostream> #include <string.h> using namespace std; int flag[130]; char s[2][10010]; int main() { int i, len[2]; for(i = 0; i <= 1; i++) { ge
阅读全文
摘要:#include <iostream> #include <algorithm> using namespace std; int c[510], num[100010]; int main() { int n, m; scanf("%d%d", &n, &m); int i; for(i = 1;
阅读全文
摘要:#include <iostream> #include <vector> #include <string.h> #include <algorithm> using namespace std; vector<int> v[2510]; char name[270000][5]; int get
阅读全文