上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 73 下一页

2025年11月29日

5-11 关键活动 (30分)

摘要: #include <iostream> #include <vector> #include <queue> using namespace std; struct node { int next, time; }; int degree[2][110], t[2][110], maxtime; v 阅读全文

posted @ 2025-11-29 14:59 王景迁 阅读(7) 评论(0) 推荐(0)

5-10 公路村村通 (30分)

摘要: #include <iostream> #include <algorithm> using namespace std; struct edge { int a, b, cost; }e[3010]; int sum[1010], tree[1010], res; int cmp(edge e1, 阅读全文

posted @ 2025-11-29 14:59 王景迁 阅读(8) 评论(0) 推荐(0)

5-10 Saving James Bond - Easy Version (25分)

摘要: #include <iostream> #include <math.h> using namespace std; struct node { int x, y, flag; }vis[110]; int flag, d, n; double getdis(int index0, int inde 阅读全文

posted @ 2025-11-29 14:59 王景迁 阅读(8) 评论(0) 推荐(0)

5-9 Huffman Codes (30分)

摘要: #include <iostream> #include <queue> #include <vector> #include <string.h> using namespace std; int judge(char a[], char b[], int alen, int blen) { in 阅读全文

posted @ 2025-11-29 14:58 王景迁 阅读(13) 评论(0) 推荐(0)

5-8 哈利·波特的考试 (25分)

摘要: #include <iostream> #include <vector> #include <string.h> using namespace std; struct node { int next, dis; }; int tree[110], sum[110], flag[110]; int 阅读全文

posted @ 2025-11-29 14:58 王景迁 阅读(11) 评论(0) 推荐(0)

5-8 File Transfer (25分)

摘要: #include <iostream> using namespace std; int tree[10010], sum[10010]; void init(int n) { int i; for(i = 1; i <= n; i++) { tree[i] = -1; sum[i] = 1; } 阅读全文

posted @ 2025-11-29 14:57 王景迁 阅读(7) 评论(0) 推荐(0)

5-7 六度空间 (30分)

摘要: #include <iostream> #include <vector> #include <queue> #include <string.h> using namespace std; vector<int> v[10010]; queue<int> q; int vis[10010], le 阅读全文

posted @ 2025-11-29 14:57 王景迁 阅读(13) 评论(0) 推荐(0)

5-5 堆中的路径 (25分)

摘要: #include <iostream> using namespace std; int num[1010]; void adjustup(int k) { num[0] = num[k]; int i = k / 2; while(i > 0 && num[0] < num[i]) { num[k 阅读全文

posted @ 2025-11-29 14:57 王景迁 阅读(10) 评论(0) 推荐(0)

5-4 是否同一棵二叉搜索树 (25分)

摘要: #include <iostream> using namespace std; struct node { int lchild, rchild, key; }tree1[10], tree2[10]; int index = -1; void initnode(node tree[], int 阅读全文

posted @ 2025-11-29 14:56 王景迁 阅读(18) 评论(0) 推荐(0)

5-3 树的同构 (25分)

摘要: #include <iostream> #include <string.h> using namespace std; struct node { int lchild, rchild; char key; }tree1[10], tree2[10]; int flag[10]; int geti 阅读全文

posted @ 2025-11-29 14:55 王景迁 阅读(8) 评论(0) 推荐(0)

上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 73 下一页

导航