随笔分类 -  刷题

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

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)

1101. Quick Sort (25)
摘要:#include <iostream> #include <vector> #include <algorithm> using namespace std; int num[100010], low[100010], high[100010]; int main() { int n; scanf( 阅读全文

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

1100. Mars Numbers (20)
摘要:#include <iostream> #include <string.h> using namespace std; char ch[2][13][5] = { "tret", "jan", "feb", "mar", "apr", "may", "jun", "jly", "aug", "se 阅读全文

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

1099. Build A Binary Search Tree (30)
摘要:#include <iostream> #include <algorithm> #include <queue> using namespace std; struct node { int lchild, rchild, key; }tree[110]; int in[110], index, 阅读全文

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

1098. Insertion or Heap Sort (25)
摘要:#include <iostream> #include <algorithm> using namespace std; int ori[110], cur[110]; void adjustdown(int k, int max) { ori[0] = ori[k]; int i; for(i 阅读全文

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

1097. Deduplication on a Linked List (25)
摘要:#include <iostream> #include <vector> using namespace std; struct node { int address, key, next; }linklist[100000]; int flag[10010]; vector<node> v[3] 阅读全文

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

1096. Consecutive Factors (20)
摘要:#include <iostream> #include <vector> #include <math.h> using namespace std; int judge(int n) { int r = sqrt(n * 1.0), i; for(i = 2; i <= r; i++) { if 阅读全文

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

1095. Cars on Campus (30)
摘要:#include <iostream> #include <string> #include <string.h> #include <vector> #include <map> #include <algorithm> using namespace std; struct node { int 阅读全文

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

1094. The Largest Generation (25)
摘要:#include <iostream> #include <vector> #include <queue> using namespace std; vector<int> v[110]; queue<int> q; int vis[110], level, maxcount, maxlevel; 阅读全文

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

1093. Count PAT's (25)
摘要:#include <iostream> #include <string.h> using namespace std; char s[100010]; int main() { gets(s); int i, len = strlen(s); long long pcount = 0, acoun 阅读全文

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

1092. To Buy or Not to Buy (20)
摘要:#include <iostream> #include <string.h> using namespace std; int aflag[130], bflag[130]; int main() { char a[1010], b[1010]; gets(a); gets(b); int len 阅读全文

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

1091. Acute Stroke (30)
摘要:#include <iostream> #include <queue> using namespace std; struct node { int x, y, z; }; queue<node> q; int flag[1300][130][70], m, n, l, vis[1300][130 阅读全文

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

1090. Highest Price in Supply Chain (25)
摘要:#include <iostream> #include <vector> #include <queue> using namespace std; vector<int> v[100010]; queue<int> q; double p, r; int res; void bfs() { in 阅读全文

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

1089. Insert or Merge (25)
摘要:#include <iostream> #include <algorithm> using namespace std; int main() { int n; scanf("%d", &n); int i, ori[110], cur[110]; for(i = 1; i <= n; i++) 阅读全文

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

1088. Rational Arithmetic (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:20 王景迁 阅读(3) 评论(0) 推荐(0)

1087. All Roads Lead to Rome (30)
摘要:#include <iostream> #include <vector> #include <string.h> using namespace std; struct node { int next, cost; }; vector<node> v[27000]; vector<int> pat 阅读全文

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

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

导航