永恒学者
永恒学者
全部文章
分类
归档
标签
去牛客网
登录
/
注册
永恒学者的博客
全部文章
(共35篇)
题解 | 验证栈序列
//算法练习 No.23 #include <iostream> #include <stack> #include <vector> using namespace std; string solve() { int n; if(!(cin >...
2026-02-06
0
4
题解 | 【模板】巴什博弈
//算法练习No.21 //寻找必胜态与必败态 #include <iostream> using namespace std; string solve() { int n,m; cin >> n >> m; if(n ...
2026-02-06
0
7
题解 | 栈和排序
//算法练习No.20 //贪心算法,输出时尽可能大 //模拟进出栈,后缀最大值 #include <iostream> #include <stack> #include <vector> #include <algorithm> using nam...
2026-02-06
0
7
题解 | 有效括号序列
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param s string字符串 * @return bool布尔型 */ ...
2026-02-05
0
7
题解 | 吐泡泡
//算法练习No.17 //直接用 std::string 当栈用,防止输出不便和连锁爆炸缺失 #include <bits/stdc++.h> using namespace std; void solve() { string s; cin >> s;/...
2026-02-05
0
9
题解 | 好串
//算法练习No.16 //stack没有迭代器! //虚拟栈 #include <bits/stdc++.h> #include <stack> using namespace std; string solve(const string&str) { ...
2026-02-05
0
7
题解 | 括号匹配深度
//算法练习No.15 //栈的思想,但未必就要写std::stack<char> //使用“虚拟栈”,将降低控件复杂度 #include <bits/stdc++.h> using namespace std; int solve(const string& s)...
2026-02-05
0
8
题解 | 小红的正整数构造
//算法练习No.14 #include <iostream> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int l,r,x; int y{-1...
2026-02-05
0
8
题解 | 小红的正整数构造
//算法练习No.14 #include <iostream> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int l,r,x; int y{-1...
2026-02-05
0
12
题解 | 旺仔哥哥转圈圈
//算法练习No.12 //模拟+循环 //使用找循环节优化代码 用于跳出重复循环 #include <vector> class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * ...
2026-02-04
0
6
首页
上一页
1
2
3
4
下一页
末页