BeauWill
BeauWill
全部文章
分类
归档
标签
去牛客网
登录
/
注册
BeauWill的博客
全部文章
(共31篇)
题解 | 小d和超级泡泡堂
Modern Cpp #include <iostream> #include <vector> #include <string> #include <array> #include <queue> int main() { std...
2026-02-18
0
11
题解 | 小红的数位删除
bfs搜索一下即可,每次枚举删除的数字是a或者b,然后枚举删除a或者b的每一个数位,通过转字符串删除该位,再转回int #include <iostream> #include <queue> #include <array> #include <map&g...
2026-02-17
0
14
题解 | 游游的最小公倍数
打表发现,其中一组答案应该接近n / 2且它两互质,因此对于每组答案,我们枚举a从n / 2到1,此时b = n - a,只要a和b互质,那么输出即可 #include <iostream> #include <vector> #include <numeric>...
2026-02-15
0
11
题解 | 中位数之和
Modern C++并使用jiangly鸽鸽的模板 #include <iostream> #include <vector> #include <cassert> #include <algorithm> using i64 = long long...
2026-02-13
0
15
题解 | 小红的数组清空
贴个multiset暴力模拟的代码 #include <iostream> #include <set> int main() { std::ios::sync_with_stdio(false); std::cin.tie(nullptr); std::cou...
2026-02-09
0
15
题解 | 文
Modern Cpp #include <iostream> #include <vector> #include <string> #include <algorithm> #include <iomanip> int main() {...
2026-02-08
0
19
题解 | 幂次进近
可能不是正解!由于k>=1,n-pow(m, k)显然单调,于是想着二分查找第一个n-pow(m, k)大于0的m,然后比较此时二分结束的l和l - 1,答案m一定在这两之中用Python写就不需要实现高精度了,记得用PyPy3解释器,Python3解释器太慢了 import sys inp...
2026-02-04
5
41
题解 | 躲藏
#include <iostream> #include <string> #include <cassert> #include <vector> using i64 = long long; constexpr i64 P = 20001204...
2026-02-02
0
22
题解 | 判断质数
Miller-Rabin素性检验(大炮轰蚊子) #include <iostream> #include <array> using i64 = long long; i64 mul(i64 a, i64 b, i64 m) { return static_cast&...
2026-01-31
0
24
题解 | 【模板】最近公共祖先(LCA)
0-base版本 #include <iostream> #include <vector> #include <functional> int main() { std::ios::sync_with_stdio(false); std::cin.ti...
2026-01-30
0
21
首页
上一页
1
2
3
4
下一页
末页