zhangjitong
zhangjitong
全部文章
分类
题解(13)
归档
标签
去牛客网
登录
/
注册
zhangjitong的博客
全部文章
(共6篇)
题解 | #[NOIP2004]合并果子#
直接上AC代码 #include<bits/stdc++.h> using namespace std; priority_queue<int,vector<int>,greater<int>>q; int n,ans; int main(){ ...
C++
贪心
队列
2024-10-04
1
99
题解 | #大水题#
容斥原理解决 AC代码如下 #include<bits/stdc++.h> using namespace std; #define int long long signed main(){ int n; while(cin>>n) cout<&...
C++
贪心
数学
2024-10-04
0
77
题解 | #Keep In Line#
STL直接模拟即可; AC代码+注释如下: #include<bits/stdc++.h> using namespace std; unordered_map<string,int>mp; queue<string>q; int ans; int main(){...
C++
模拟
队列
贪心
2024-10-04
2
111
题解 | #好串#
根据栈的定义即可判断 AC代码如下 #include<iostream> using namespace std; int main(){ string s;cin>>s; int ans=0; for(int i=0;i<s.size();i+...
C++
栈
贪心
2024-10-04
0
85
题解 | #Rails#
只需要纯模拟出栈即可,记得初始化哦 代码如下 #include<bits/stdc++.h> using namespace std; stack<int>sk; int a[100010]; int main(){ while(1){ int n;c...
C++
栈
数组
贪心
2024-10-04
1
96
题解 | #栈#
见代码注释 #include<bits/stdc++.h> using namespace std; int a[1000100],r,n; stack<int>sk; int main(){ cin>>n;r=n; for(int i=1;i&l...
C++
栈
数组
贪心
2024-10-04
1
84