Problem:
My accepted Code is given below:
#include<bits/stdc++.h>
using namespace std;
int main()
{
long long ar[1009],i,j,n,x,temp,f,ff,fff;
while(cin>>n)
{
f=0;
ff=0;
fff=0;
for(i=0;i<n;i++)
{
cin>>x;
if(i==0)
temp=x;
else
{
if((f==-1&&temp<x)||(fff==-1&&temp<x)||(f==-1&&temp==x))
ff=1;
//if()
else if(temp>x)
f=-1;
else if(temp==x)
fff=-1;
// cout<<f<<" "<<ff<<" "<<temp<<" "<<x<<endl;
temp=x;
}
}
if(ff==1)
cout<<"NO"<<endl;
else
cout<<"YES"<<endl;
}
return 0;
}
#include<bits/stdc++.h>
using namespace std;
int main()
{
long long ar[1009],i,j,n,x,temp,f,ff,fff;
while(cin>>n)
{
f=0;
ff=0;
fff=0;
for(i=0;i<n;i++)
{
cin>>x;
if(i==0)
temp=x;
else
{
if((f==-1&&temp<x)||(fff==-1&&temp<x)||(f==-1&&temp==x))
ff=1;
//if()
else if(temp>x)
f=-1;
else if(temp==x)
fff=-1;
// cout<<f<<" "<<ff<<" "<<temp<<" "<<x<<endl;
temp=x;
}
}
if(ff==1)
cout<<"NO"<<endl;
else
cout<<"YES"<<endl;
}
return 0;
}
Casino Games - How you Can Play Games for Fun at the Beginners
ReplyDeleteFor 라이브 배팅 the ultimate fun entertainment melbet experience, here at 토토 하는 법 BikiniCasino, we offer a fun-filled casino that has endless 먹튀 랭크 fun to play! 더킹바카라