随笔分类 -  刷题

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

1046. Shortest Distance (20)
摘要:#include <iostream> using namespace std; int dis[100010]; void swap(int &a, int &b) { int temp = a; a = b; b = temp; } int getmin(int a, int b) { if(a 阅读全文

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

1045. Favorite Color Stripe (30)
摘要:#include <iostream> using namespace std; int fav[210], ori[10010], res[210][10010]; int getmax(int a, int b) { if(a > b) { return a; } else { return b 阅读全文

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

1044. Shopping in Mars (25)
摘要:#include <iostream> #include <vector> using namespace std; struct node { int begin, end; }; vector<long long> v; int getindex(int low, int high, long 阅读全文

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

1043. Is It a Binary Search Tree (25)
摘要:#include <iostream> #include <vector> using namespace std; struct node { int lchild, rchild, key; }tree[1010]; int pre[1010], r = 1, first = 1, choose 阅读全文

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

1042. Shuffling Machine (20)
摘要:#include <iostream> using namespace std; int main() { int k; scanf("%d", &k); int res[55], index[55], i; for(i = 1; i <= 54; i++) { scanf("%d", &index 阅读全文

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

1041. Be Unique (20)
摘要:#include <iostream> #include <vector> using namespace std; int flag[10010]; int main() { int n; scanf("%d", &n); int i, num; vector<int> v; for(i = 1; 阅读全文

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

1040. Longest Symmetric String (25)
摘要:#include <iostream> #include <string.h> using namespace std; int main() { char s[1010]; gets(s); int len = strlen(s), i, count, res = 0, j, k; for(i = 阅读全文

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

1039. Course List for Student (25)
摘要:#include <iostream> #include <vector> #include <algorithm> using namespace std; vector<int> v[270000]; int getbigindex(char s[]) { return (s[0] - 'A') 阅读全文

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

1038. Recover the Smallest Number (30)
摘要:#include <iostream> #include <string.h> #include <string> #include <algorithm> #include <vector> using namespace std; int cmp(string a, string b) { st 阅读全文

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

1037. Magic Coupon (25)
摘要:#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { int nc; scanf("%d", &nc); int i; vector<long long> v[4]; 阅读全文

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

1036. Boys vs Girls (25)
摘要:#include <iostream> using namespace std; struct node { char name[20], gender, id[20]; int grade; }; int main() { int n; scanf("%d", &n); int i, grade[ 阅读全文

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

1035. Password (20)
摘要:#include <iostream> #include <vector> #include <string.h> using namespace std; struct node { char name[20], password[20]; }; int main() { int n; scanf 阅读全文

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

1034. Head of a Gang (30)
摘要:#include <iostream> #include <vector> #include <algorithm> using namespace std; int tree[2010], sum[2010], smallindex[2010], bigindex[27000], weight[2 阅读全文

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

1033. To Fill or Not to Fill (25)
摘要:#include <iostream> #include <algorithm> using namespace std; struct node { double dis, p; }stations[510]; int cmp(node n1, node n2) { return n1.dis < 阅读全文

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

1032. Sharing (25)
摘要:#include <iostream> #include <vector> using namespace std; struct node { int address, next; char data; }nod[100000]; int main() { int begin[2], n; sca 阅读全文

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

1031. Hello World for U (20)
摘要:#include <iostream> #include <string.h> using namespace std; int main() { char s[100]; gets(s); int n1, n2, n = strlen(s), flag = 0; for(n2 = 3; n2 <= 阅读全文

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

1030. Travel Plan (30)
摘要:#include <iostream> #include <vector> #include <string.h> using namespace std; struct node { int next, dis, cost; }; int main() { int n, m, s, d; scan 阅读全文

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

1029. Median (25)
摘要:#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { int n; scanf("%d", &n); int i; long int num; vector<long 阅读全文

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

1028. List Sorting (25)
摘要:#include <iostream> #include <algorithm> #include <string.h> using namespace std; struct node { int id, score; char name[10]; }stu[100010]; int c; int 阅读全文

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

1027. Colors in Mars (20)
摘要:#include <iostream> #include <vector> using namespace std; int main() { int num, i; vector<int> v[4]; for(i = 1; i <= 3; i++) { scanf("%d", &num); if( 阅读全文

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

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

导航