随笔分类 -  PAT (Basic Level) Practice

1077 互评成绩计算 (20 point(s))
摘要:中间写错了一次,错把分组数 N - 1 当初平均分的人数,实际的人数应该不包含 [0,M] 范围之外,并且要剔除最高和最低分的人。 后面调试时候才发现测试样例是有重复数据的,所以不能用 set 得用 multiset 。用 map 和 set 的时候还是得注意数据里面是否有重复的数据,不然就像前面 阅读全文

posted @ 2021-09-14 22:49 Atl212 阅读(53) 评论(0) 推荐(0)

1076 Wifi密码 (15 point(s))
摘要:#include <bits/stdc++.h> using namespace std; int main() { int n; char opt[4][2], c; cin >> n; while(n--){ getchar(); scanf("%c-%c %c-%c %c-%c %c-%c", 阅读全文

posted @ 2021-09-14 09:05 Atl212 阅读(50) 评论(0) 推荐(0)

1075 链表元素分类 (25 point(s))
摘要:// 20 points #include <bits/stdc++.h> using namespace std; struct Node{ string Address; int flag; }; int main() { int n, k, Data; string first, Addres 阅读全文

posted @ 2021-09-14 08:28 Atl212 阅读(47) 评论(0) 推荐(0)

1069 微博转发抽奖 (20 point(s))
摘要:// 15 points #include <bits/stdc++.h> using namespace std; int main() { int m, n, s; map<string, int> isTaken; map<int, string> weibo; cin >> m >> n > 阅读全文

posted @ 2021-09-13 23:20 Atl212 阅读(77) 评论(0) 推荐(0)

1062 最简分数 (20 point(s))
摘要:// 2 points #include <bits/stdc++.h> using namespace std; int gcd(int a, int b){ return b ? gcd(b, a % b) : a; } int main() { int n1, m1, n2, m2, k; s 阅读全文

posted @ 2021-09-12 23:29 Atl212 阅读(86) 评论(0) 推荐(0)

1073 多选题常见计分法 (20 point(s))
摘要:#include <bits/stdc++.h> using namespace std; struct Question{ double score, num, cor; set<char> copt; map<char, int> fault; }; int main() { // 输入 学生人 阅读全文

posted @ 2021-09-12 16:03 Atl212 阅读(70) 评论(0) 推荐(0)

1074 宇宙无敌加法器 (20 point(s))
摘要:#include <bits/stdc++.h> using namespace std; int change(string& str){ int tmp = str[str.size()-1] - '0'; str.erase(str.size()-1, 1); return tmp; } bo 阅读全文

posted @ 2021-09-11 23:16 Atl212 阅读(98) 评论(0) 推荐(0)

1072 开学寄语 (20 point(s))
摘要:#include <bits/stdc++.h> using namespace std; int main() { int n, m, s = 0, t = 0; set<string> unlegal; cin >> n >> m; while(m--){ string str; cin >> 阅读全文

posted @ 2021-09-10 23:00 Atl212 阅读(62) 评论(0) 推荐(0)

1071 小赌怡情 (15 point(s))
摘要:#include <bits/stdc++.h> using namespace std; int main() { int T, K, n1, b, t, n2, x; cin >> T >> K; // 初始化当前筹码 x = T; while(K--){ cin >> n1 >> b >> t 阅读全文

posted @ 2021-09-10 22:22 Atl212 阅读(25) 评论(0) 推荐(0)

1060 爱丁顿数 (25 point(s))
摘要:// 18 points #include <bits/stdc++.h> using namespace std; int main() { int n, days = 0; // key存储距离 val存储距离累积的天数 map<int , int> E; cin >> n; while(n-- 阅读全文

posted @ 2021-09-08 17:46 Atl212 阅读(161) 评论(0) 推荐(0)

1068 万绿丛中一点红 (20 point(s))
摘要:// 16 points #include <bits/stdc++.h> using namespace std; struct Loction{ int i, j; }; int main() { // N行 M列 图像 分辨率 TOL 所求像素点与相邻点的颜色差阈值 int m, n, TOL 阅读全文

posted @ 2021-09-08 07:59 Atl212 阅读(49) 评论(0) 推荐(0)

1067 试密码 (20 point(s))
摘要:// 13 points #include <bits/stdc++.h> using namespace std; int main() { string pass, check; int N; cin >> pass >> N; while(cin >> check){ if(check == 阅读全文

posted @ 2021-09-07 17:48 Atl212 阅读(52) 评论(0) 推荐(0)

1066 图像过滤 (15 point(s))
摘要:#include <bits/stdc++.h> using namespace std; int main() { int m, n, a, b, grey; cin >> m >> n >> a >> b >> grey; // 读取 int pic[m][n]; for(int i = 0; 阅读全文

posted @ 2021-09-07 12:38 Atl212 阅读(35) 评论(0) 推荐(0)

1065 单身狗 (25 point(s))
摘要:#include <bits/stdc++.h> using namespace std; int main() { // N 夫妻/伴侣的对数 ID 号 5 位数字 // M 派对的总人数 M 位客人的 ID int n, m; map<string, string> couples; set<s 阅读全文

posted @ 2021-09-07 12:13 Atl212 阅读(70) 评论(0) 推荐(0)

1064 朋友数 (20 point(s))
摘要:#include <bits/stdc++.h> using namespace std; int main() { int n, tmp, a, b, c, d, first = 0; set<int> fri; cin >> n; while(n--){ cin >> tmp; a = tmp 阅读全文

posted @ 2021-09-07 08:12 Atl212 阅读(35) 评论(0) 推荐(0)

1063 计算谱半径 (20 point(s))
摘要:#include <bits/stdc++.h> using namespace std; int main() { float n, max = 0, a, b; cin >> n; while(n--){ cin >> a >> b; if(max < a * a + b * b) max = 阅读全文

posted @ 2021-09-07 08:00 Atl212 阅读(69) 评论(0) 推荐(0)

1061 判断题 (15 point(s))
摘要:#include <bits/stdc++.h> using namespace std; int main() { int n, m, score, judge; cin >> n >> m; int ques[m][2] = {0}; for(int i = 0; i < m; i++){ ci 阅读全文

posted @ 2021-09-06 22:18 Atl212 阅读(18) 评论(0) 推荐(0)

1059 C语言竞赛 (20 point(s))
摘要:// 10 #include <bits/stdc++.h> using namespace std; struct Stu{ int rank, existed; }; bool prime(int p){ for(int i = 2; i <= sqrt(p); i++) if(p % i == 阅读全文

posted @ 2021-09-06 07:52 Atl212 阅读(67) 评论(0) 推荐(0)

1010 一元多项式求导 (25 point(s))
摘要:// 19 points #include <bits/stdc++.h> using namespace std; int main(){ int k1, e1, first = 0; while(scanf("%d %d", &k1, &e1) != EOF){ int k2 = k1 * e1 阅读全文

posted @ 2021-09-05 22:23 Atl212 阅读(31) 评论(0) 推荐(0)

1008 数组元素循环右移问题 (20 point(s))
摘要:#include <bits/stdc++.h> using namespace std; int main(){ int n, m, num[101]; cin >> n >> m; for(int i = 0; i < n; i++){ cin >> num[i]; } for(int i = 阅读全文

posted @ 2021-09-05 21:57 Atl212 阅读(46) 评论(0) 推荐(0)

导航