随笔分类 -  刷题

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

1086. Tree Traversals Again (25)
摘要:#include <iostream> #include <stack> using namespace std; struct node { int lchild, rchild, key; }tree[40]; int pre[40], in[40], r = 1, first = 1; int 阅读全文

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

1085. Perfect Sequence (25)
摘要:#include <iostream> #include <algorithm> using namespace std; long long num[100010]; int getindex(int low, int high, long long goal) { int mid; while( 阅读全文

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

1084. Broken Keyboard (20)
摘要:#include <iostream> #include <string.h> using namespace std; int flag[130]; void higherchar(char &ch) { if(ch >= 'a' && ch <= 'z') { ch -= 32; } } int 阅读全文

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

1083. List Grades (25)
摘要:#include <iostream> using namespace std; struct node { char name[20], id[20]; }stu[110]; int flag[110]; int main() { int n; scanf("%d", &n); int i, gr 阅读全文

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

1082. Read Number in Chinese (25)
摘要:#include <iostream> #include <string.h> using namespace std; int first = 1; void setfirst() { if(first == 1) { first = 0; } else { printf(" "); } } in 阅读全文

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

1081. Rational Sum (20)
摘要:#include <iostream> using namespace std; long long getsame(long long a, long long b) { if(b != 0) { return getsame(b, a % b); } else { return a; } } v 阅读全文

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

1080. Graduate Admission (30)
摘要:#include <iostream> #include <algorithm> #include <vector> using namespace std; struct node { int id, ge, gi, choice[5]; double finalgrade; }stu[40010 阅读全文

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

1079. Total Sales of Supply Chain (25)
摘要:#include <iostream> #include <queue> #include <vector> using namespace std; double p, r, res, amount[100010]; queue<int> q; vector<int> v[100010]; voi 阅读全文

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

1078. Hashing (25)
摘要:#include <iostream> #include <math.h> using namespace std; int flag[10010]; int judge(int n) { if(n == 1) { return 0; } int r = sqrt(n * 1.0), i; for( 阅读全文

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

1077. Kuchiguse (20)
摘要:#include <iostream> #include <string.h> using namespace std; int main() { int n; scanf("%d", &n); getchar(); char a[260]; gets(a); int alen = strlen(a 阅读全文

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

1076. Forwards on Weibo (30)
摘要:#include <iostream> #include <vector> #include <queue> #include <string.h> using namespace std; int l, vis[1010], level, res; vector<int> v[1010]; que 阅读全文

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

1075. PAT Judge (25)
摘要:#include <iostream> #include <algorithm> #include <string.h> #include <vector> using namespace std; struct node { int id, score[6], fullmarknum, total 阅读全文

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

1074. Reversing Linked List (25)
摘要:#include <iostream> #include <vector> using namespace std; struct node { int address, key, next; }nod[100010]; int main() { int begin, n, k; scanf("%d 阅读全文

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

1073. Scientific Notation (20)
摘要:#include <iostream> #include <string.h> using namespace std; char s[10010], former[10010]; int main() { gets(s); if(s[0] == '-') { printf("-"); } int 阅读全文

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

1072. Gas Station (30)
摘要:#include <iostream> #include <string.h> #include <vector> using namespace std; struct node { int next, dis; }; int n; int getindex(char s[]) { int ind 阅读全文

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

1071. Speech Patterns (25)
摘要:#include <iostream> #include <string> #include <string.h> #include <map> using namespace std; char s[1048580], cur[1048580], res[1048580]; int judge(c 阅读全文

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

1070. Mooncake (25)
摘要:#include <iostream> #include <algorithm> using namespace std; struct node { double amounts, prices, perprice; }mooncakes[1010]; int cmp(node n1, node 阅读全文

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

1069. The Black Hole of Numbers (20)
摘要:#include <iostream> #include <string.h> #include <algorithm> using namespace std; int cmp(char a, char b) { return a > b; } int main() { int num[2]; s 阅读全文

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

1068. Find More Coins (30)
摘要:#include <iostream> #include <vector> #include <algorithm> using namespace std; int num[10010], arr[10010], n, m, flag; vector<int> path; void printpa 阅读全文

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

1067. Sort with Swap(0) (25)
摘要:#include <iostream> using namespace std; int index[100010], num[100010]; int main() { int n; scanf("%d", &n); int i, count = 0; for(i = 0; i < n; i++) 阅读全文

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

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

导航