
Codeforces
易橙
FDU硕士在读,退役ACMer。
展开
-
【数据结构】骚操作--单调栈
以cf622(Div.2)的C2题为例讲解一下吧:**题意:**就是找单峰值。建设大楼,要求每栋楼有限高,而且不允许存在一栋楼两边都有比他更高的楼,要求建成的楼总高度最大。这里我们引入一个单调栈的东西:花了2小时才算勉强搞明白了(感谢wucstdio大佬)这里运用单调栈来做的话,时间复杂度只有O(n),难点在于这个单调栈该如何去写。下面上ac的代码,里面单调栈的部分运用了2次,分别是求上升...原创 2020-02-24 14:09:55 · 203 阅读 · 0 评论 -
2020牛客寒假算法基础集训营2 题解报告
A:做游戏签到#include<bits/stdc++.h>using namespace std;#define ll long longint main(){ ll a,b,c;ll x,y,z; cin>>a>>b>>c>>x>>y>>z; cout<<min(a,y)+min(...原创 2020-02-07 16:14:37 · 513 阅读 · 0 评论 -
长安大学寒假第二次排位赛部分题解
B:#include<iostream>#include<cmath>#include<algorithm>#define ll long long#define endl '\n'#define mem(a) memset(a,0,sizeof(a))#define IO ios::sync_with_stdio(false);cin.tie(...原创 2020-02-05 13:43:31 · 260 阅读 · 0 评论 -
Codeforces Round #615(Div.3)
A - Collecting Coins#include<bits/stdc++.h>#define ll long long#define rep(i,a,n) for(int i=a;i<=n;i++)#define per(i,n,a) for(int i=n;i>=a;i--)#define endl '\n'#define mem(a) memset(...原创 2020-01-23 14:55:50 · 298 阅读 · 0 评论 -
Codeforces Round #614(Div.2)
A. ConneR and the A.R.C. Markland-Nhttps://codeforces.com/contest/1293/problem/A**题意:**t次输入。每次输入2行,第一行输入n,s,k。n代表有几层楼,s代表你所在的位置,k代表不营业的餐厅的总层数。第二行k次输入,代表每一个不营业的层数。这个题搞了好久,想想是A题应该很简单几分钟能过的,最后用set过的...原创 2020-01-20 14:31:38 · 543 阅读 · 0 评论 -
Codeforces Round#579 div3
https://www.e-learn.cn/content/qita/2590422原创 2019-08-14 17:57:46 · 131 阅读 · 0 评论 -
#Codeforces Round#582(div.3)
Problem A:http://codeforces.com/contest/1213/problem/A#include<bits/stdc++.h>using namespace std;int main(){ int n; while(cin>>n){ int a[105]; int single=0,even=0; for(int i=...原创 2019-08-31 13:45:22 · 135 阅读 · 0 评论