满加
满加
全部文章
分类
归档
标签
去牛客网
登录
/
注册
满加的博客
全部文章
(共53篇)
题解 | 构造数对
C++ ①暴力 ②令a=b,当b<=x且b^2>x时,符合条件(不知道不满足时其他也都不满足怎么证明) #include <iostream> using namespace std; int main() { int x; cin >> x; ...
2025-08-22
0
33
题解 | 最大 FST 距离
C++ 注意下标 10^5*10^5 = 10^10 > 2*10^9超出 int 表示范围 #include <climits> #include <iostream> #include <vector> using namespace std; int...
2025-08-21
0
28
题解 | 谐距下标对
C++ 一方面暴力枚举易超时,另一方面计算下标对要用 (unsigned) long long 才够用 #include <iostream> #include <map> #include <vector> using namespace std; int m...
2025-08-21
2
28
题解 | 小红书推荐系统
C++ 用到了unordered_map、pair、sort lambda表达式 #include <algorithm> #include <iostream> #include <string> #include <unordered_map> #...
2025-08-19
0
51
题解 | 分数线划定
C++ sort默认升序,通过lambda表达式,定义两个元素的比较顺序实现自定义排序。注意参数列表里面是要比较的参数的类型 #include <algorithm> #include <iostream> #include <vector> using name...
2025-08-19
1
26
题解 | 【模板】排序
C++ 冒泡排序、选择排序时间复杂度为O(n^2),快速排序、归并排序时间复杂度为O(nlogn) #include <any> #include <iostream> #include <utility> #include <vector> usin...
2025-08-18
0
47
题解 | 回文日期
C++ 遍历年份、注意月份和日期取值范围即可 #include <iostream> using namespace std; int main() { string a, b; cin >> a >> b; // YYYYMMDD ...
2025-08-18
0
32
题解 | 乒乓球
C++ #include <iostream> using namespace std; int main() { string wl; cin >> wl; int w11=0, l11=0; for (auto i:wl) { ...
2025-08-17
0
26
题解 | 多项式输出
C++ 数字转为字符串to_string以及注意 +-、系数为1,指数为1的处理 #include <iostream> #include <string> #include <vector> using namespace std; int main() { ...
2025-08-17
0
35
题解 | 纸牌游戏
C++ #include <iostream> using namespace std; int main() { int t, a1, a2, b1, b2; cin >> t; while (t--) { cin >>...
2025-08-17
0
34
首页
上一页
1
2
3
4
5
6
下一页
末页