随笔分类 - PAT Basic Level
摘要:比赛链接:https://pintia.cn/market/item/1371703238093053952 7-1 打印三角形拼图 (15 分) 题解 找规律。 代码 #include <bits/stdc++.h> using namespace std; int main() { ios::s
阅读全文
摘要:比赛链接:https://pintia.cn/market/item/1336191032829964288 7-1 祖传好运 (15 分) 题解 递归判断即可。 代码 #include <bits/stdc++.h> using namespace std; bool ok(int x) { if
阅读全文
摘要:比赛链接:https://pintia.cn/market/item/1302816969611366400 7-1 多二了一点 (15分) 题解 模拟。 代码 #include <bits/stdc++.h> using namespace std; int sum(string s) { int
阅读全文
摘要:比赛链接:https://pintia.cn/market/item/1287964475579875328 7-1 对称日 题解 模拟,注意年月日不足位在前面补零。 代码 #include <bits/stdc++.h> using namespace std; map<string, strin
阅读全文
摘要:比赛链接:https://pintia.cn/market/item/1097414703086837760 A - 检查密码 Tips 密码中可能有空格,所以需要用 getline() 。 代码 #include <bits/stdc++.h> using namespace std; void
阅读全文
摘要:比赛链接:https://pintia.cn/market/item/1103202531901689856 7-1 大美数 题解 模拟即可。 Tips 这题通过率只有 $0.09$,可能是大部分人搞错了整除的关系,$a$ 整除 $b$ 表示为 $b\ \%\ a = 0$ 。 代码 #includ
阅读全文
摘要:比赛链接:https://pintia.cn/market/item/1203557339918098432 7-1 2019数列 题解 简单的递推。 代码 #include <bits/stdc++.h> using namespace std; int main() { int f[1005]
阅读全文
摘要:比赛链接:https://pintia.cn/market/item/1170913498742468608 7-1 B是A的多少倍 题意 将一个数后 $d$ 位截下移到最高位前面,得到的新数是原数的多少倍。 代码 #include <bits/stdc++.h> using namespace s
阅读全文
摘要:题目链接:https://pintia.cn/problem-sets/994805260223102976/problems/994805320306507776 #include <bits/stdc++.h> using namespace std; int main() { int n; c
阅读全文
摘要:题目链接:https://pintia.cn/problem-sets/994805260223102976/problems/994805324509200384 #include <bits/stdc++.h> using namespace std; map<char, string> mp{
阅读全文
摘要:#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int cnt = 0; while (n != 1) { if (n & 1) n = (3 * n + 1) / 2; else n /= 2;
阅读全文
摘要:#include <bits/stdc++.h> using namespace std; int main() { string str; getline(cin, str); int cnt[26] = {}; for (char c : str) if (isalpha(c)) ++cnt[t
阅读全文

浙公网安备 33010602011771号