#include<cstdio>
int n,a[];
int main(){
scanf("%d",&n);
for(int i=;i<=n;++i)scanf("%d",a+i);
int L=,R=n;
while(L<n&&a[L]<a[L+])++L;
while(R>&&a[R]<a[R-])--R;
for(int i=L+;i<=R;++i)if(a[L]!=a[i])return puts("NO"),;
return puts("YES"),;
}
 #include <iostream>
using namespace std;
int N;
int V[];
int main()
{
cin>>N;
for(int i=;i<=N;i++)cin>>V[i];
int i=;
while(i<N&&V[i]<V[i+])i++;
while(i<N&&V[i]==V[i+])i++;
while(i<N&&V[i]>V[i+])i++;
if(i<N)cout<<"NO";
else cout<<"YES";
return ;
}
 #include<iostream>
#include<cstdio>
using namespace std;
int n;
int a[];
int main()
{
scanf("%d",&n);
for(int i=;i<=n;i++)scanf("%d",a+i);
int i=;
while(i+<=n && a[i+]>a[i])i++;
while(i+<=n && a[i+]==a[i])i++;
while(i+<=n && a[i+]<a[i])i++;
if(i<n)printf("NO");else printf("YES");
return ;
}
 #include<bits/stdc++.h>
using namespace std; int main()
{
int n;
cin>>n;
int arr[n];
for(int i=;i<n;i++)
cin>>arr[i];
int i=;
while(arr[i+]>arr[i] && i+<n)
i++;
while(arr[i]==arr[i+] && i+<n)
i++;
while(arr[i]>arr[i+] && i+<n)
i++;
if(i==n-)
cout<<"YES";
else cout<<"NO"; }
 #include <bits/stdc++.h>

 using namespace std;

 int a[];
int n;
void sol(string s) {
cout << s;
exit();
}
int main() {
#ifndef ONLINE_JUDGE
freopen("CF.in", "r", stdin);
#endif
cin >> n;
for (int i = ; i <= n; ++i)cin >> a[i];
int i=;
while(i+<=n&&a[i]<a[i+])++i;
while(i+<=n&&a[i]==a[i+])++i;
while(i+<=n)
{
if(a[i]<=a[i+])sol("NO");
++i;
}sol("YES");
}

Codeforces Round #424 A(模拟)的更多相关文章

  1. Codeforces Round #424 (Div. 2, rated, based on VK Cup Finals) - B

    题目链接:http://codeforces.com/contest/831/problem/B 题意:给第2个26个字母并不重复的字符串(2个字符串对于一个映射),第1个字符串为key集合,第2个字 ...

  2. Codeforces Round #424 (Div. 2, rated, based on VK Cup Finals)

    http://codeforces.com/contest/831 A. Unimodal Array time limit per test 1 second memory limit per te ...

  3. Codeforces Round #424 (Div. 2, rated, based on VK Cup Finals)A,B,C

    A:链接:http://codeforces.com/contest/831/problem/A 解题思路: 从前往后分别统计递增,相等,递减序列的长度,如果最后长度和原序列长度相等那么就输出yes: ...

  4. Codeforces Round #424 (Div. 2, rated, based on VK Cup Finals) Problem F (Codeforces 831F) - 数论 - 暴力

    题目传送门 传送门I 传送门II 传送门III 题目大意 求一个满足$d\sum_{i = 1}^{n} \left \lceil \frac{a_i}{d} \right \rceil - \sum ...

  5. Codeforces Round #424 (Div. 2, rated, based on VK Cup Finals) Problem D (Codeforces 831D) - 贪心 - 二分答案 - 动态规划

    There are n people and k keys on a straight line. Every person wants to get to the office which is l ...

  6. Codeforces Round #424 (Div. 2, rated, based on VK Cup Finals) Problem E (Codeforces 831E) - 线段树 - 树状数组

    Vasily has a deck of cards consisting of n cards. There is an integer on each of the cards, this int ...

  7. Codeforces Round #424 (Div. 2, rated, based on VK Cup Finals) Problem C (Codeforces 831C) - 暴力 - 二分法

    Polycarp watched TV-show where k jury members one by one rated a participant by adding him a certain ...

  8. Codeforces Round #424 (Div. 2, rated, based on VK Cup Finals) Problem A - B

    Array of integers is unimodal, if: it is strictly increasing in the beginning; after that it is cons ...

  9. Codeforces Round #424 (Div. 2, rated, based on VK Cup Finals) E. Cards Sorting 树状数组

    E. Cards Sorting time limit per test 1 second memory limit per test 256 megabytes input standard inp ...

随机推荐

  1. Netscaler的超高端口复用助力应对公网地址紧张

    Netscaler的超高端口复用助力应对公网地址紧张 http://blog.51cto.com/caojin/1898351 经常会有人问一个IP只有65535(姑且不考虑预留端口),从Big-ip ...

  2. cdh版本的hadoop安装及配置(伪分布式模式) MapReduce配置 yarn配置

    安装hadoop需要jdk依赖,我这里是用jdk8 jdk版本:jdk1.8.0_151 hadoop版本:hadoop-2.5.0-cdh5.3.6 hadoop下载地址:链接:https://pa ...

  3. Visual Studio调试之符号文件

    原文链接地址:http://www.cnblogs.com/killmyday/archive/2009/10/14/1582882.html 前面在不能设置断点的检查步骤和Visual Studio ...

  4. POJ 开关问题 解题报告

    开关问题 Time Limit: 1000MS Memory Limit: 30000K Description 有N个相同的开关,每个开关都与某些开关有着联系,每当你打开或者关闭某个开关的时候,其他 ...

  5. CentOs7 minimal安装后没有ifconfig命令解决方法

    没有ifconfig命令目前我了解两个原因: 1./sbin/ifconfig 可以执行,但是ifconfig无法执行.这个解决的时候只需要将/sbin 添加到PATH下就可以了. 2.系统未安装if ...

  6. angular js自定义service的简单示例

    <!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8" ...

  7. 复选框 checkbox 选中事件

    项目中用的jquery-1.11 今天需要检测一个checkbox的选中状态,想当然的用 .attr("checked") ,结果发现,无论是否选中,这个值都是 undefined ...

  8. codeforce C. Okabe and Boxes

    题目传送门 这道题 每次删除一个点 那么这个点必然在栈里面 那么如果堆顶不是他 我们就需要一次操作使得堆合理 这时我们可以把他删除然后把他下面的点打个标记表示这下面的点以后想怎么排就怎么排以后都不需要 ...

  9. [bzoj3990][SDOI2015]排序-搜索

    Brief Description 小A有一个1-2^N的排列A[1..2^N],他希望将A数组从小到大排序,小A可以执行的操作有N种,每种操作最多可以执行一次,对于所有的i(1<=i<= ...

  10. 关于dlib人脸对比,人脸识别

    人脸检测 人脸特征点提取 人脸对比,等于两张人脸对比,识别 封装的所有识别函数,直接看下面调用就好了. # coding:utf-8 ''' 本本次封装,我主要是做两张人脸对比. 就只人脸识别部分,简 ...