PAT刷题之旅
天上地下,唯我独尊
这个作者很懒,什么都没留下…
展开
-
PAT乙级1086 就不告诉你 (15 分)测试点
https://pintia.cn/problem-sets/994805260223102976/problems/1038429065476579328测试用例10 101#include <iostream>#include <string>using namespace std;int main(){ int a, b, cnt = 0; cin ...原创 2019-07-23 16:14:37 · 228 阅读 · 0 评论 -
PAT乙级1076 Wifi密码 (15 分)
https://pintia.cn/problem-sets/994805260223102976/problems/994805262622244864#include <iostream>using namespace std;int main(){ string s; while(cin >> s) if(s.size()==3 && s...原创 2019-07-22 18:33:47 · 101 阅读 · 0 评论 -
PAT乙级1077 互评成绩计算 (20 分)
https://pintia.cn/problem-sets/994805260223102976/problems/994805262303477760#include <iostream>#include <algorithm>using namespace std;int main(){ int N, M; cin >> N >> ...原创 2019-07-22 19:16:15 · 98 阅读 · 0 评论 -
PAT乙级1078 字符串压缩与解压 (20 分)
https://pintia.cn/problem-sets/994805260223102976/problems/994805262018265088#include <iostream>#include <string>using namespace std;int main(){ char order, tmpc; string s; cin >...原创 2019-07-23 10:01:41 · 116 阅读 · 0 评论 -
PAT乙级1079 延迟的回文数 (20 分)
https://pintia.cn/problem-sets/994805260223102976/problems/994805261754023936首先确定给定的整数是不是回文串 如果是就不需要输出A+B=C了#include <iostream>#include <algorithm>#include <string>using namespa...原创 2019-07-23 11:00:49 · 110 阅读 · 0 评论 -
PAT乙级1080 MOOC期终成绩 (25 分)测试点3
https://pintia.cn/problem-sets/994805260223102976/problems/994805261493977088测试点3是指总分是59.5也算合格,,是不是很坑??题不难 用map 很麻烦#include <iostream>#include <algorithm>#include <string>#incl...原创 2019-07-23 11:37:05 · 1011 阅读 · 0 评论 -
PAT乙级1081 检查密码 (15 分)测试点2
https://pintia.cn/problem-sets/994805260223102976/problems/994805261217153024日常坑就是密码里有空格测试点2#include <iostream>#include <string>using namespace std;int check(string s){ int flag1 = ...原创 2019-07-23 12:43:11 · 680 阅读 · 1 评论 -
PAT乙级1082 射击比赛 (20 分)
https://pintia.cn/problem-sets/994805260223102976/problems/994805260990660608#include <iostream>#include <algorithm>using namespace std;struct node{ string name; int x;};bool cmp(n...原创 2019-07-23 13:16:38 · 139 阅读 · 0 评论 -
PAT乙级1083 是否存在相等的差 (20 分)
https://pintia.cn/problem-sets/994805260223102976/problems/9948052607809454080也是差值,否则12测试点不过#include <iostream>#include <cmath> using namespace std;int main(){ int n, num, cha[10002]...原创 2019-07-23 14:14:58 · 132 阅读 · 0 评论 -
PAT乙级1084 外观数列 (20 分)
https://pintia.cn/problem-sets/994805260223102976/problems/994805260583813120#include <iostream>#include <string>using namespace std;int main(){ string s, tmp = ""; int n; cin >&...原创 2019-07-23 14:37:22 · 125 阅读 · 0 评论 -
PAT乙级1075 链表元素分类 (25 分)思路
https://pintia.cn/problem-sets/994805260223102976/problems/9948052629535948801.先用个数组把元素装起来2.从单链表头开始 遍历元素 分成3组1)负值2)小于K3)大于K3.然后三个组顺序遍历输出就完事了#include <iostream>#include <vector>usi...原创 2019-07-22 18:06:05 · 220 阅读 · 0 评论 -
PAT乙级1073 多选题常见计分法 (20 分)(这道题太恶心了,恶心啊)
https://pintia.cn/problem-sets/994805260223102976/problems/994805263624683520全是坑 题干太长了#include <iostream>#include <map>using namespace std;struct test { double maxscore = 0.0, halfsc...原创 2019-07-22 17:18:15 · 386 阅读 · 0 评论 -
PAT乙级1074 宇宙无敌加法器 (20 分)测试点分析
https://pintia.cn/problem-sets/994805260223102976/problems/994805263297527808这道题做的真是稀碎…主要坑点:进制标中“d”和“0”表示10进制结果为0结果的最后一个carry(进位)不等于0时#include <iostream>#include <algorithm>using n...原创 2019-07-22 14:16:26 · 632 阅读 · 0 评论 -
PAT乙级1087 有多少不同的值 (20 分) 注意数组大小
https://pintia.cn/problem-sets/994805260223102976/problems/1038429191091781632注意数组大小#include <iostream>using namespace std;int main(){ int N, n, cnt = 0, h[12005] = {0}; cin >> N; f...原创 2019-07-23 16:25:40 · 84 阅读 · 0 评论 -
PAT乙级1088 三人行 (20 分)
https://pintia.cn/problem-sets/994805260223102976/problems/1038429286185074688注意丙是double类型#include <iostream>#include <cmath>using namespace std;void f(int a, double b){ if(a > b)...原创 2019-07-24 09:03:30 · 126 阅读 · 0 评论 -
PAT乙级1090 危险品装箱 (25 分)思路
https://pintia.cn/problem-sets/994805260223102976/problems/1038429484026175488首选建立一个二维数组V(很大,以物品编号为一维下标),然后把每个不相容的物品放进去 比如按例子来说:6 320001 2000220003 2000420005 2000620003 2000120005 2000420004 ...原创 2019-07-24 09:09:43 · 237 阅读 · 0 评论 -
PAT乙级1091 N-自守数 (15 分)
https://pintia.cn/problem-sets/994805260223102976/problems/1071785664454127616#include <iostream>#include <cmath>using namespace std;int main(){ int K, N, M, cnt = 0, tmpk; cin >&...原创 2019-07-24 09:32:14 · 99 阅读 · 0 评论 -
PAT乙级1092 最好吃的月饼 (20 分)
https://pintia.cn/problem-sets/994805260223102976/problems/1071785779399028736#include <iostream>using namespace std;int main(){ int max = 0, N, M, num[1001] = {0}, cnt = 0; cin >> N ...原创 2019-07-24 12:26:19 · 150 阅读 · 0 评论 -
PAT乙级1093 字符串A+B (20 分)
https://pintia.cn/problem-sets/994805260223102976/problems/1071785884776722432#include <iostream>#include <string>using namespace std;int main(){ string A, B; int h[300] = {0}; getl...原创 2019-07-24 12:34:04 · 71 阅读 · 0 评论 -
PAT乙级1094 谷歌的招聘 (20 分)
https://pintia.cn/problem-sets/994805260223102976/problems/1071785997033074688#include <iostream>#include <string>#include <cmath>using namespace std;bool isp(int num){ for(int...原创 2019-07-24 14:12:36 · 175 阅读 · 0 评论 -
PAT乙级1095 解码PAT准考证 (25 分)
https://pintia.cn/problem-sets/994805260223102976/problems/1071786104348536832借鉴的柳神思路https://blog.csdn.net/liuchuo/article/details/84972869#include <iostream>#include <vector>#include...原创 2019-07-24 16:03:56 · 190 阅读 · 0 评论 -
PAT乙级1072 开学寄语 (20 分)
https://pintia.cn/problem-sets/994805260223102976/problems/994805263964422144#include <iostream>using namespace std;int main(){ int N, M, num[10000] = {0}, cnt1 = 0, cnt2 = 0; cin >> ...原创 2019-07-22 10:52:37 · 66 阅读 · 0 评论 -
PAT乙级1085 PAT单位排行 (25 分)
https://pintia.cn/problem-sets/994805260223102976/problems/994805260353126400一个学校的结构体数组,下标从1开始分配读入数据时,用map检测学校是否出现过,如果没有出现过,就分配新的下标,否则就用以前的下标#include <iostream>#include <map>#include ...原创 2019-07-23 15:49:34 · 135 阅读 · 0 评论