2025年11月23日

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 王景迁 阅读(4) 评论(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 王景迁 阅读(3) 评论(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)

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 王景迁 阅读(4) 评论(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 王景迁 阅读(5) 评论(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 王景迁 阅读(2) 评论(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 王景迁 阅读(3) 评论(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)

1066. Root of AVL Tree (25)

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

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

1065. A+B and C (64bit) (20)

摘要: #include <iostream> using namespace std; int main() { int n; scanf("%d", &n); long long a, b, c, res; int i, flag; for(i = 1; i <= n; i++) { scanf("%l 阅读全文

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

1064. Complete Binary Search Tree (30)

摘要: #include <iostream> #include <algorithm> #include <queue> using namespace std; struct node { int lchild, rchild, key; }tree[1010]; int num[1010], r = 阅读全文

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

1063. Set Similarity (25)

摘要: #include <iostream> #include <set> using namespace std; int main() { int n; scanf("%d", &n); int i, k, j, next; set<int> s[60]; for(i = 1; i <= n; i++ 阅读全文

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

1062. Talent and Virtue (25)

摘要: #include <iostream> #include <vector> #include <algorithm> using namespace std; struct node { int ID_Number, Virtue_Grade, Talent_Grade, total; }; int 阅读全文

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

1061. Dating (20)

摘要: #include <iostream> #include <string.h> using namespace std; int main() { char s[4][70]; int i, len[4]; for(i = 0; i < 4; i++) { gets(s[i]); len[i] = 阅读全文

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

1060. Are They Equal (25)

摘要: #include <iostream> #include <string.h> using namespace std; struct node { int d; char s[110]; }; int n; node getnode(char s[]) { int firstpos = -1, p 阅读全文

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

1059. Prime Factors (25)

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

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

1058. A+B in Hogwarts (20)

摘要: #include <iostream> using namespace std; int main() { int a[3], b[3]; scanf("%d.%d.%d %d.%d.%d", &a[0], &a[1], &a[2], &b[0], &b[1], &b[2]); int add; a 阅读全文

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

1057. Stack (30)

摘要: #include <iostream> #include <stack> using namespace std; int c[100010]; int lowbit(int x) { return x & (-x); } int getsum(int x) { int sum = 0; while 阅读全文

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

1056. Mice and Rice (25)

摘要: #include <iostream> #include <vector> using namespace std; int main() { int np, ng; scanf("%d%d", &np, &ng); int weight[1010], i; for(i = 0; i < np; i 阅读全文

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

1055. The World's Richest (25)

摘要: #include <iostream> #include <string.h> #include <vector> #include <algorithm> using namespace std; struct node { char name[10]; int age, worth; }; in 阅读全文

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

1054. The Dominant Color (20)

摘要: #include <iostream> using namespace std; int c[100000000]; int main() { int m, n; scanf("%d%d", &m, &n); int i, j, num, max = 0, res; for(i = 0; i < n 阅读全文

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

1053. Path of Equal Weight (30)

摘要: #include <iostream> #include <vector> #include <algorithm> using namespace std; int s, w[110], vis[110]; vector<int> v[110], path; void printpath() { 阅读全文

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

1052. Linked List Sorting (25)

摘要: #include <iostream> #include <algorithm> #include <vector> using namespace std; struct node { int address, key, next; }nod[100000]; int cmp(node n1, n 阅读全文

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

1051. Pop Sequence (25)

摘要: #include <iostream> #include <stack> using namespace std; int main() { int m, n, k; scanf("%d%d%d", &m, &n, &k); int i, num[1010], j, index, flag, beg 阅读全文

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

1049. Counting Ones (30)

摘要: #include <iostream> using namespace std; int main() { int n; scanf("%d", &n); int low, mid, high, d = 1, res = 0; while(n >= d) { high = n / (d * 10); 阅读全文

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

1050. String Subtraction (20)

摘要: #include <iostream> #include <string.h> using namespace std; int flag[130]; char s[2][10010]; int main() { int i, len[2]; for(i = 0; i <= 1; i++) { ge 阅读全文

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

1048. Find Coins (25)

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

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

1047. Student List for Course (25)

摘要: #include <iostream> #include <vector> #include <string.h> #include <algorithm> using namespace std; vector<int> v[2510]; char name[270000][5]; int get 阅读全文

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

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 王景迁 阅读(2) 评论(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 王景迁 阅读(4) 评论(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 王景迁 阅读(5) 评论(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)

1026. Table Tennis (30)

摘要: #include <iostream> #include <vector> #include <algorithm> using namespace std; struct node { int arriving, playing, hour, minute, second; }; int tabl 阅读全文

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

1025. PAT Ranking (25)

摘要: #include <iostream> #include <vector> #include <algorithm> using namespace std; struct node { long long registration_number; int score, location_numbe 阅读全文

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

1024. Palindromic Number (25)

摘要: #include <iostream> #include <string.h> using namespace std; int judge(char s[]) { int len = strlen(s), i, r = len / 2 - 1; for(i = 0; i <= r; i++) { 阅读全文

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

1023. Have Fun with Numbers (20)

摘要: #include <iostream> #include <string.h> using namespace std; int charcount[2][10]; char s[2][30]; void setstringcount(int index) { int len = strlen(s[ 阅读全文

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

1022. Digital Library (30)

摘要: #include <iostream> #include <string> #include <string.h> #include <map> #include <vector> #include <algorithm> using namespace std; int main() { int 阅读全文

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

1021. Deepest Root (25)

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

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

1020. Tree Traversals (25)

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

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

1019. General Palindromic Number (20)

摘要: #include <iostream> #include <vector> using namespace std; int main() { int n, b; scanf("%d%d", &n, &b); if(n == 0) { printf("Yes\n0\n"); return 0; } 阅读全文

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

1018. Public Bike Management (30)

摘要: #include <iostream> #include <vector> using namespace std; struct node { int next, t; }; vector<node> v[510]; vector<int> path, res; int perfect, sp, 阅读全文

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

1017. Queueing at Bank (25)

摘要: #include <iostream> #include <vector> #include <algorithm> using namespace std; struct node { int arriving, processing; }; int cmp(node n1, node n2) { 阅读全文

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

1016. Phone Bills (25)

摘要: #include <iostream> #include <map> #include <string> #include <string.h> #include <vector> #include <algorithm> using namespace std; struct node { int 阅读全文

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

1015. Reversible Primes (20)

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

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

1014. Waiting in Line (30)

摘要: #include <iostream> #include <queue> using namespace std; int main() { int n, m, k, q; scanf("%d%d%d%d", &n, &m, &k, &q); int processing[1010], i, res 阅读全文

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

1013. Battle Over Cities (25)

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

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

1012. The Best Rank (25)

摘要: #include <iostream> #include <algorithm> using namespace std; struct node { int id, score[5]; }stu[2010]; int flag[1000000], bestrankindex[1000000], c 阅读全文

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

1011. World Cup Betting (20)

摘要: #include <iostream> using namespace std; int main() { int index[3], i, j; double max[3], cur; for(i = 0; i <= 2; i++) { for(j = 0; j <= 2; j++) { scan 阅读全文

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

1010. Radix (25)

摘要: #include "stdafx.h" #include <iostream> #include <string.h> using namespace std; long long getnumbychar(char c) { long long num; if(c >= '0' && c <= ' 阅读全文

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

1009. Product of Polynomials (25)

摘要: #include "stdafx.h" #include <iostream> #include <map> using namespace std; int main() { int n1; scanf("%d", &n1); int i, a; double b; map<int, double 阅读全文

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

1008. Elevator (20)

摘要: #include "stdafx.h" #include <iostream> using namespace std; int main() { int n; scanf("%d", &n); int former = 0, i, res = n * 5, cur; for(i = 1; i <= 阅读全文

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

1007. Maximum Subsequence Sum (25)

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

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

1006. Sign In and Sign Out (25)

摘要: #include "stdafx.h" #include <iostream> #include <string.h> using namespace std; int main() { int n; scanf("%d", &n); int i, j, hour[2], second[2], mi 阅读全文

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

1005. Spell It Right (20)

摘要: #include "stdafx.h" #include <iostream> #include <string.h> using namespace std; int main() { char a[110]; gets(a); int sum = 0, i, len = strlen(a); f 阅读全文

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

1004. Counting Leaves (30)

摘要: #include "stdafx.h" #include <iostream> #include <queue> using namespace std; vector<int> v[110]; queue<int> q; int vis[110], first = 1; void bfs() { 阅读全文

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

1003. Emergency (25)

摘要: #include "stdafx.h" #include <iostream> #include <vector> using namespace std; struct node { int next, length; }; vector<node> v[510]; int team[510], 阅读全文

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

1002. A+B for Polynomials (25)

摘要: #include "stdafx.h" #include <iostream> #include <map> using namespace std; int main() { int n1; scanf("%d", &n1); map<int, double> id; int i, a; doub 阅读全文

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

导航