合集-补题
摘要:
A. Cidoai的幂次序列 思路 思维题 题面看着复杂,但只需输出 \(n-1\) 和 \(1\) 即可。 代码 #include <iostream> using namespace std; typedef long long ll; ll n, k; int main() { cin >>
阅读全文
A. Cidoai的幂次序列 思路 思维题 题面看着复杂,但只需输出 \(n-1\) 和 \(1\) 即可。 代码 #include <iostream> using namespace std; typedef long long ll; ll n, k; int main() { cin >>
阅读全文
摘要:
A-困难数学题 思路 \(x\) \(xor\) \(x\) \(xor\) \(x\) \(xor\) \(x\),异或有结合律,\(x\) \(xor\) \(x\) \(= 0\),\(0\) \(xor\) \(0\) \(= 0\),所以本题直接输出0。 代码 #include <iost
阅读全文
A-困难数学题 思路 \(x\) \(xor\) \(x\) \(xor\) \(x\) \(xor\) \(x\),异或有结合律,\(x\) \(xor\) \(x\) \(= 0\),\(0\) \(xor\) \(0\) \(= 0\),所以本题直接输出0。 代码 #include <iost
阅读全文
摘要:
A-tb的区间问题 思路 前缀和 我的解法蠢了,就是做一个前缀和和一个后缀和,枚举前i个和后k-i个,取一个max值就是答案。 但其实这题不用这么麻烦,不管删除第一个还是最后一个,最后都会留下一组连续的大小为n-k的子数组,所以我们只需要做一个前缀和,从第n-k开始,每次作为结尾向前取n-k个数,取
阅读全文
A-tb的区间问题 思路 前缀和 我的解法蠢了,就是做一个前缀和和一个后缀和,枚举前i个和后k-i个,取一个max值就是答案。 但其实这题不用这么麻烦,不管删除第一个还是最后一个,最后都会留下一组连续的大小为n-k的子数组,所以我们只需要做一个前缀和,从第n-k开始,每次作为结尾向前取n-k个数,取
阅读全文
摘要:
A-Letter Song 签到题 代码 #include <iostream> using namespace std; int main() { int a, b, c; char x; cin >> a >> x >> b >> x >> c; a += 10; printf("%04d-%0
阅读全文
A-Letter Song 签到题 代码 #include <iostream> using namespace std; int main() { int a, b, c; char x; cin >> a >> x >> b >> x >> c; a += 10; printf("%04d-%0
阅读全文
摘要:
P11076 「FSLOI Round I」单挑 思路 最多连续胜利的场数最少是多少,其实就是在剩余的S里面插入F的连续胜场的最大值是多,以为要先小S获胜,可以插入的空的数量就是剩余S的大小,平均值上取整就是答案。 代码 #include <iostream> #include <algorithm
阅读全文
P11076 「FSLOI Round I」单挑 思路 最多连续胜利的场数最少是多少,其实就是在剩余的S里面插入F的连续胜场的最大值是多,以为要先小S获胜,可以插入的空的数量就是剩余S的大小,平均值上取整就是答案。 代码 #include <iostream> #include <algorithm
阅读全文
摘要:
A-小红的字符移动 签到题 代码 #include <iostream> using namespace std; int main() { string s; cin >> s; swap(s[0], s[1]); cout << s; } B-小红的数轴移动 一道模拟题吧,按题意要求进行操作。
阅读全文
A-小红的字符移动 签到题 代码 #include <iostream> using namespace std; int main() { string s; cin >> s; swap(s[0], s[1]); cout << s; } B-小红的数轴移动 一道模拟题吧,按题意要求进行操作。
阅读全文

浙公网安备 33010602011771号