满加
满加
全部文章
分类
归档
标签
去牛客网
登录
/
注册
满加的博客
全部文章
(共51篇)
题解 | 谐距下标对
C++ 一方面暴力枚举易超时,另一方面计算下标对要用 (unsigned) long long 才够用 #include <iostream> #include <map> #include <vector> using namespace std; int m...
2025-08-21
0
12
题解 | 小红书推荐系统
C++ 用到了unordered_map、pair、sort lambda表达式 #include <algorithm> #include <iostream> #include <string> #include <unordered_map> #...
2025-08-19
0
22
题解 | 分数线划定
C++ sort默认升序,通过lambda表达式,定义两个元素的比较顺序实现自定义排序。注意参数列表里面是要比较的参数的类型 #include <algorithm> #include <iostream> #include <vector> using name...
2025-08-19
0
12
题解 | 【模板】排序
C++ 冒泡排序、选择排序时间复杂度为O(n^2),快速排序、归并排序时间复杂度为O(nlogn) #include <any> #include <iostream> #include <utility> #include <vector> usin...
2025-08-18
0
12
题解 | 回文日期
C++ 遍历年份、注意月份和日期取值范围即可 #include <iostream> using namespace std; int main() { string a, b; cin >> a >> b; // YYYYMMDD ...
2025-08-18
0
13
题解 | 乒乓球
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
12
题解 | 多项式输出
C++ 数字转为字符串to_string以及注意 +-、系数为1,指数为1的处理 #include <iostream> #include <string> #include <vector> using namespace std; int main() { ...
2025-08-17
0
20
题解 | 纸牌游戏
C++ #include <iostream> using namespace std; int main() { int t, a1, a2, b1, b2; cin >> t; while (t--) { cin >>...
2025-08-17
0
16
题解 | 计算一年中的第几天
C++ #include <iostream> using namespace std; int main() { int y, m, d; while (cin >> y >> m >> d) { switch (m...
2025-08-17
1
21
题解 | 小红的夹吃棋
C++ 注意:若双方均无被夹吃,或双方均被夹吃,则为平局(而不是夹吃个数相等) #include <array> #include <iostream> #include <vector> using namespace std; int main() { ...
2025-08-17
0
20
首页
上一页
1
2
3
4
5
6
下一页
末页