背不过八股的瓦学弟
背不过八股的瓦学弟
全部文章
分类
归档
标签
去牛客网
登录
/
注册
背不过八股的瓦学弟的博客
全部文章
(共4篇)
题解 | #小球投盒#
看到这个题第一眼没思路,第二眼直接上线段树区间修改,看了题解发现怪不得这题难度是简单[牛泪]最高赞题解妙啊[赞] #include <bits/stdc++.h> template<class T> struct Segt { struct node { ...
2024-11-25
0
47
题解 | #游游的除2操作#
考虑到数据范围,只有不超过 次的÷2操作,那么每次对非最小值÷2,然后排序,判断是否全为同一值即可。 #include <bits/stdc++.h> int main() { std::ios::sync_with_stdio(false), std::cin.tie(nul...
2024-11-20
0
42
题解 | #游游的整数切割#
假设s中有x个奇数数字(1、3、5、7、9),y个偶数数字。若s的最后一个数字为奇数,那么切割后第一个数的最后一个数字也需要是奇数,答案为x-1(减去s最后的那个奇数,不能把所有数字都划到左边);偶数同理。 #include <iostream> #include <string&...
2024-11-19
1
50
题解 | #C++选择排序#
#include <iostream> using namespace std; int main() { int arr[6] = { 0 }; int len = sizeof(arr) / sizeof(int); for (int i = 0...
2023-05-05
0
164