随笔分类 -  刷题

上一页 1 2 3 4 5 6 7 8 下一页

1066. Root of AVL Tree (25)
摘要:#include <iostream> #include <stdlib.h> using namespace std; typedef struct node { int key, bf; struct node *lchild, *rchild; }*bnode; void rrotate(bn 阅读全文

posted @ 2025-11-23 17:13 王景迁 阅读(3) 评论(0) 推荐(0)

1065. A+B and C (64bit) (20)
摘要:#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 阅读全文

posted @ 2025-11-23 17:13 王景迁 阅读(4) 评论(0) 推荐(0)

1064. Complete Binary Search Tree (30)
摘要:#include <iostream> #include <algorithm> #include <queue> using namespace std; struct node { int lchild, rchild, key; }tree[1010]; int num[1010], r = 阅读全文

posted @ 2025-11-23 17:12 王景迁 阅读(4) 评论(0) 推荐(0)

1063. Set Similarity (25)
摘要:#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++ 阅读全文

posted @ 2025-11-23 17:12 王景迁 阅读(3) 评论(0) 推荐(0)

1062. Talent and Virtue (25)
摘要:#include <iostream> #include <vector> #include <algorithm> using namespace std; struct node { int ID_Number, Virtue_Grade, Talent_Grade, total; }; int 阅读全文

posted @ 2025-11-23 17:12 王景迁 阅读(2) 评论(0) 推荐(0)

1061. Dating (20)
摘要:#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] = 阅读全文

posted @ 2025-11-23 17:11 王景迁 阅读(2) 评论(0) 推荐(0)

1060. Are They Equal (25)
摘要:#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 阅读全文

posted @ 2025-11-23 17:11 王景迁 阅读(3) 评论(0) 推荐(0)

1059. Prime Factors (25)
摘要:#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 = 阅读全文

posted @ 2025-11-23 17:11 王景迁 阅读(2) 评论(0) 推荐(0)

1058. A+B in Hogwarts (20)
摘要:#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 阅读全文

posted @ 2025-11-23 17:10 王景迁 阅读(1) 评论(0) 推荐(0)

1057. Stack (30)
摘要:#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 阅读全文

posted @ 2025-11-23 17:10 王景迁 阅读(3) 评论(0) 推荐(0)

1056. Mice and Rice (25)
摘要:#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 阅读全文

posted @ 2025-11-23 17:10 王景迁 阅读(2) 评论(0) 推荐(0)

1055. The World's Richest (25)
摘要:#include <iostream> #include <string.h> #include <vector> #include <algorithm> using namespace std; struct node { char name[10]; int age, worth; }; in 阅读全文

posted @ 2025-11-23 17:09 王景迁 阅读(2) 评论(0) 推荐(0)

1054. The Dominant Color (20)
摘要:#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 阅读全文

posted @ 2025-11-23 17:09 王景迁 阅读(3) 评论(0) 推荐(0)

1053. Path of Equal Weight (30)
摘要:#include <iostream> #include <vector> #include <algorithm> using namespace std; int s, w[110], vis[110]; vector<int> v[110], path; void printpath() { 阅读全文

posted @ 2025-11-23 17:09 王景迁 阅读(3) 评论(0) 推荐(0)

1052. Linked List Sorting (25)
摘要:#include <iostream> #include <algorithm> #include <vector> using namespace std; struct node { int address, key, next; }nod[100000]; int cmp(node n1, n 阅读全文

posted @ 2025-11-23 17:09 王景迁 阅读(5) 评论(0) 推荐(0)

1051. Pop Sequence (25)
摘要:#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 阅读全文

posted @ 2025-11-23 17:08 王景迁 阅读(6) 评论(0) 推荐(0)

1049. Counting Ones (30)
摘要:#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); 阅读全文

posted @ 2025-11-23 17:08 王景迁 阅读(4) 评论(0) 推荐(0)

1050. String Subtraction (20)
摘要:#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 阅读全文

posted @ 2025-11-23 17:08 王景迁 阅读(5) 评论(0) 推荐(0)

1048. Find Coins (25)
摘要:#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; 阅读全文

posted @ 2025-11-23 17:07 王景迁 阅读(5) 评论(0) 推荐(0)

1047. Student List for Course (25)
摘要:#include <iostream> #include <vector> #include <string.h> #include <algorithm> using namespace std; vector<int> v[2510]; char name[270000][5]; int get 阅读全文

posted @ 2025-11-23 17:07 王景迁 阅读(4) 评论(0) 推荐(0)

上一页 1 2 3 4 5 6 7 8 下一页

导航