B. Creating the Contest(水题)
Posted alingmaomao
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了B. Creating the Contest(水题)相关的知识,希望对你有一定的参考价值。
直接水过
#include<iostream> #include<algorithm> using namespace std; const int maxn=2e5+10; int a[maxn]; int n, u,maxx; int main(){ cin>>n; u=1; for(int i=0;i<n;++i)cin>>a[i]; for(int i=0;i<n-1;++i){ if(a[i]*2>=a[i+1]){ ++u; } else{ maxx=max(maxx, u); u=1; } } maxx=max(maxx, u); cout<<maxx<<endl; }
以上是关于B. Creating the Contest(水题)的主要内容,如果未能解决你的问题,请参考以下文章
codeforce1029B B. Creating the Contest(简单dp,简单版单调栈)
Codeforces Round #506 (Div. 3)B.Creating the Contest(dp)
The 13th Chinese Northeast Contest B. Balanced Diet(前缀和)
The 17th Zhejiang Provincial Contest B. Bin Packing Problem(线段树+map)
The Preliminary Contest for ICPC Asia Shanghai 2019 B. Light bulbs
The Preliminary Contest for ICPC Asia Shanghai 2019 B. Light bulbs