Codeforces Round #424 (Div. 2, rated, based on VK Cup Finals), problem: (A) Unimodal Array Solution In C/C++

#include<cstdio>
using namespace std;
int n,i,la,nw,fl,tp;
int main(){
for(scanf(“%d%d”,&n,&la);++i<n;la=nw,fl=tp)
if(scanf(“%d”,&nw),fl>(tp=(nw>la?0:(nw<la?2:1))))return puts(“NO”);
return puts(“YES”);
}

(Visited 64 times, 1 visits today)

About the Author:

Leave A Comment