https://i0.wp.com/eblogarithm.com/wp-content/uploads/2017/07/Codeforces-Round-424-Div-2-rated-based-on-VK-Cup-Finals-problem-A-Unimodal-Array-Solution-In-CC1.png?fit=640%2C360

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 24 times, 1 visits today)



There are no comments

Add yours

Leave a Reply

%d bloggers like this: