sleeep3
sleeep3
全部文章
分类
题解(15)
归档
标签
去牛客网
登录
/
注册
sleeep3的博客
全部文章
(共15篇)
#题解##P1083 [NOIP 2012 提高组] 借教室#
利用了差分,前缀和和二分 #include<bits/stdc++.h> using namespace std; const int N=1e6; long long n,m,j[N+10],sh[N+10],st[N+10],ed[N+10],diff[N+10],pre[N+10]...
C++
2025-12-11
0
12
#题解##P2678 [NOIP 2015 提高组] 跳石头#
我选择用二分答案来解决 #include<bits/stdc++.h> using namespace std; int arr[50010]={0}; int l,n,m; bool pd(int a)//判断是否满足移除m块岩石//传入枚举的答案长度 { int num=0,...
C++
2025-12-11
0
7
#题解##UVA11572#
我使用了c++的set容器,set容器具有去重 #include<bits/stdc++.h> using namespace std; set<int>v; int main() { int jc; int t; cin>>t; ...
C++
2025-12-11
0
12
#题解##POJ-3061#
利用尺取法的反向扫描 #include<iostream> #include<algorithm> #include<vector> #include<stack> #include<string> #include<cstdio&g...
C++
2025-12-11
0
7
题解 | #HDU2527#
哈夫曼树 #include<iostream> #include<algorithm> #include<vector> #include<stack> #include<string> #include<cstdio> #in...
C++
2025-12-05
0
10
题解 | #洛谷P1030求先序排列#
利用递归以及后序排列最后一位为根解决。 #include<iostream> #include<algorithm> #include<vector> #include<stack> #include<string> using names...
2025-12-05
0
11
题解 | #洛谷P1449后缀表达式#
本题我使用数组来代替栈了。 #include<iostream> #include<algorithm> #include<vector> #include<stack> #include<string> using namespace s...
C++
2025-12-05
0
8
#题解##洛谷P5788单调栈#
单调栈存放下标,详情见注释 #include<iostream> #include<algorithm> #include<vector> #include<stack> #include<string> using namespace s...
C++
2025-12-05
0
9
题解 | #洛谷P1739表达式括号匹配#
表达式的括号匹配实际上就是每个左右括号是否有相对的另一半。所以有栈来模拟顺序。 #include<bits/stdc++.h> using namespace std; stack<char>v; int main() { string s; cin>&...
C++
2025-12-05
0
10
题解 | #Rails#
题目中说死胡同,所以使用栈模拟 #include<bits/stdc++.h> using namespace std; int n,f,zt=0,zv=1,p=0; int arr[1100]; stack<int>v; int main() { while(1) ...
C++
2025-11-28
0
8
首页
上一页
1
2
下一页
末页