2025年11月25日

1102. Invert a Binary Tree (25)

摘要: #include <iostream> #include <queue> using namespace std; struct node { int lchild, rchild, key; }tree[10]; queue<int> q; int flag, first = 1, bfscoun 阅读全文

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

1103. Integer Factorization (30)

摘要: #include "stdafx.h" #include <iostream> #include <algorithm> #include <queue> #include <string.h> using namespace std; vector<int> path, res; int k, p 阅读全文

posted @ 2025-11-25 09:10 王景迁 阅读(4) 评论(0) 推荐(0)

1104. Sum of Number Segments (20)

摘要: #include <iostream> using namespace std; double num[100010]; int main() { int n; scanf("%d", &n); int i; for(i = 1; i <= n; i++) { scanf("%lf", &num[i 阅读全文

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

1105. Spiral Matrix (25)

摘要: #include <iostream> #include <algorithm> #include <algorithm> using namespace std; int num[10010], arr[110][110]; int cmp(int a, int b) { return a > b 阅读全文

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

1106. Lowest Price in Supply Chain (25)

摘要: #include <iostream> #include <vector> #include <queue> using namespace std; double p, r; vector<int> v[100010]; queue<int> q; int flag, bfscount; void 阅读全文

posted @ 2025-11-25 09:10 王景迁 阅读(4) 评论(0) 推荐(0)

1107. Social Clusters (30)

摘要: #include <iostream> #include <vector> #include <algorithm> using namespace std; int tree[1010], sum[1010]; vector<int> v[1010]; int cmp(int a, int b) 阅读全文

posted @ 2025-11-25 09:10 王景迁 阅读(4) 评论(0) 推荐(0)

1108. Finding Average (20)

摘要: #include <iostream> #include <string.h> using namespace std; int main() { int n; scanf("%d", &n); int i, len, xiaoshu, j, begin, pointcount, flag, num 阅读全文

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

1109. Group Photo (25)

摘要: #include <iostream> #include <string.h> #include <algorithm> using namespace std; struct node { int height; char name[10]; }people[10010]; char res[10 阅读全文

posted @ 2025-11-25 09:10 王景迁 阅读(4) 评论(0) 推荐(0)

1110. Complete Binary Tree (25)

摘要: #include <iostream> #include <queue> #include <string.h> using namespace std; struct node { int lchild, rchild; }tree[30]; queue<int> q; int res = 1, 阅读全文

posted @ 2025-11-25 09:10 王景迁 阅读(4) 评论(0) 推荐(0)

1111. Online Map (30)

摘要: #include <iostream> #include <vector> #include <string.h> using namespace std; struct node { int next, length, time; }; void print(vector<int> v) { in 阅读全文

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

1112. Stucked Keyboard (20)

摘要: #include <iostream> #include <string.h> #include <vector> using namespace std; int flag[130]; void print(vector<char> v) { int i, size = v.size(); for 阅读全文

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

1113. Integer Set Partition (25)

摘要: #include <iostream> #include <algorithm> using namespace std; int num[100010]; int main() { int n; scanf("%d", &n); int i, sum = 0; for(i = 1; i <= n; 阅读全文

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

1114. Family Property (25)

摘要: #include <iostream> #include <vector> #include <algorithm> #include <string.h> using namespace std; int tree[10000], sum[10000], flag[10000], estate[1 阅读全文

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

1115. Counting Nodes in a BST (30)

摘要: #include <iostream> #include <queue> using namespace std; struct node { int lchild, rchild, key; }tree[1010]; int index = -1, n1, n2; queue<int> q; vo 阅读全文

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

1116. Come on! Let's C (20)

摘要: #include <iostream> #include <math.h> using namespace std; int finalrank[10000]; int judge(int n) { int i, r = sqrt(n * 1.0); for(i = 2; i <= r; i++) 阅读全文

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

1117. Eddington Number(25)

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

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

1118. Birds in Forest (25)

摘要: #include <iostream> #include <vector> using namespace std; int flag[10010], sum[10010], tree[10010]; vector<int> v; void init(int id) { tree[id] = -1; 阅读全文

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

1119. Pre- and Post-order Traversals (30)

摘要: #include <iostream> #include <vector> using namespace std; int pre[40], post[40], flag = 1; vector<int> v; int getindex(int a, int b, int d) { int i; 阅读全文

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

1121. Damn Single (25)

摘要: #include <iostream> #include <algorithm> #include <vector> #include <string.h> using namespace std; int couple[100000], party[100000], num[100000]; in 阅读全文

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

1122. Hamiltonian Cycle (25)

摘要: #include <iostream> #include <string.h> using namespace std; int path[210][210]; int main() { int n, m; scanf("%d%d", &n, &m); int i, a, b; for(i = 1; 阅读全文

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

1120. Friend Numbers (20)

摘要: #include <iostream> #include <algorithm> #include <vector> #include <string.h> using namespace std; int flag[50]; int main() { int n; scanf("%d", &n); 阅读全文

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

1123. Is It a Complete AVL Tree (30)

摘要: #include <iostream> #include <stdlib.h> #include <queue> using namespace std; typedef struct node { int key, bf; struct node *lchild, *rchild; }*bnode 阅读全文

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

导航