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