牛客754921490号
牛客754921490号
全部文章
分类
归档
标签
去牛客网
登录
/
注册
牛客754921490号的博客
全部文章
(共44篇)
题解 | 数独数组
#include <iostream> #include <vector> using namespace std; int main() { int n; cin >> n; vector<int> cnt(9,0); ...
2025-12-16
0
8
题解 | 小数字
#include <iostream> #include <cmath> using namespace std; // m的最大值是1e9,硬算必然超时 // 主要的思路是:n < 3开始,-1就是最优解 // 前面开方、除2实际上不会计算很多次 // n < ...
2025-12-16
0
7
题解 | 挡住洪水
#include <iostream> #include <vector> using namespace std; struct Pt { int y; int x; }; int main() { int xLen,yLen; cin &g...
2025-12-15
0
7
题解 | 小红的字符串
#include <iostream> using namespace std; int GetCnt(char a, char b) { return min(abs((a-b+26)%26), abs((b-a+26)%26)); } int main() { str...
2025-12-15
0
7
题解 | 灵异背包?
#include <iostream> #include <vector> #include <algorithm> using namespace std; // 偶数全收,奇数攒着排序后取前 size()/2 * 2 部分 int main() { i...
2025-12-15
0
8
题解 | 01序列
#include <iostream> using namespace std; // n个连续的0可以插入的1的数量:首尾n/2;中间(n-1)/2; int main() { int m; cin >> m; int zMax = 0; i...
2025-12-15
0
6
题解 | 小红的魔法药剂
#include <iostream> #include <vector> #include <unordered_map> #include <algorithm> using namespace std; // 蓝色只能用红色抓换,不能用转换得到...
2025-12-15
0
7
题解 | 小心火烛的歪
#include <iostream> #include <cstdint> #include <vector> using namespace std; // 移位时,立即数默认是32位,一定要指定为64位 bool invalid = true; vector...
2025-12-15
0
7
题解 | 百钱买百鸡问题
#include <iostream> using namespace std; // 穷举,或者简单算一下 int main() { // int a = 5*3; // int b = 3*3; // int c = 1; // int total =...
2025-12-15
0
6
题解 | 最大 FST 距离
// 一脸懵,完全不会,参考其他人答案 // 主要逻辑思路,转成单数据比较 // 展开绝对值,得到 i*i + a*a, i*i-a*a, 两种数据 // 读取后算出两个数组,排序,取最大最小位置差值,再max即可 #include <iostream> #include <vec...
2025-12-14
0
11
首页
上一页
1
2
3
4
5
下一页
末页