佛系的青年
佛系的青年
全部文章
分类
归档
标签
去牛客网
登录
/
注册
佛系的青年的博客
全部文章
(共89篇)
题解 | 数组分组
写完代码才发现能优化的地方太多了 果然还是太嫩了,优化点如下:首先可以直接用n % 3 == 0来判断n是3的倍数 不用先除再乘like a idiot其次就是要体会 if(index == c.size()) {return target == 0;}和if(index ==c.size()...
2025-03-12
0
52
题解 | 在字符串中找出连续最长的数字串
代码的掌控能力还是不太行 老是遗漏某种情况…… #include <iostream> #include <vector> #include <cctype> #include <algorithm> using namespace std; int...
2025-03-12
0
53
题解 | 走方格的方案数
动规真得好好练练了 最简单的动规都把递推式想错了可恶啊 #include <iostream> #include <vector> using namespace std; int main() { int n, m; cin >> n >...
2025-03-12
0
55
题解 | 合法IP
笑死 照着测试案例试出来的 排除个两三种情况直接就过了 #include <iostream> #include <bits/stdc++.h> using namespace std; bool is_legal(string s) { if(s.size() &...
2025-03-12
0
39
题解 | 24点运算
遍历回溯 #include <iostream> #include <vector> #include <algorithm> using namespace std; bool is24(const vector<int>& nums, c...
2025-03-12
0
73
题解 | 扑克牌大小
比较考验各种情况的讨论 是否有遗漏和重复 很好的一道练习题 #include <iostream> #include <sstream> #include <vector> #include <unordered_map> using namespac...
2025-03-11
0
66
题解 | 最长回文子串
暴力嘿嘿 #include <iostream> #include <algorithm> using namespace std; bool is_palindrome(string s, int start, int end) { while(start <...
2025-03-11
0
65
题解 | 密码强度等级
思路不难 纯练习稳定性 #include <iostream> #include <cctype> using namespace std; int main() { string password; int score = 0; cin >&...
2025-03-11
0
52
题解 | 求最大连续bit数
<bitset>真好用 #include <iostream> #include <bitset> using namespace std; int main() { int n; cin >> n; bitset<32...
2025-03-11
0
48
题解 | 统计大写字母个数
#include <iostream> #include <cctype> using namespace std; int main() { string s; getline(cin, s); int count = 0; for(int...
2025-03-10
0
36
首页
上一页
1
2
3
4
5
6
7
8
9
下一页
末页