#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. BZOJ 3668:起床困难综合症(贪心)

    分析:按位贪心即可. program sleep; var a,g:..]of longint; n,i,m,ans,t,len,x,y,v:longint; c:char; s:string; e: ...

  2. 【bzoj4152】[AMPPZ2014]The Captain 堆优化Dijkstra

    题目描述 给定平面上的n个点,定义(x1,y1)到(x2,y2)的费用为min(|x1-x2|,|y1-y2|),求从1号点走到n号点的最小费用. 输入 第一行包含一个正整数n(2<=n< ...

  3. 解决IIS设置多个工作进程中Session失效的问题

    利用StateServer实现Session共享 session保存在专门的StateServer中,该种方式,性能损失比sql略好.比inproc据说有10%-15%的性能损失.怎么使用StateS ...

  4. [poj 3261]后缀数组+滑窗最小值

    题目链接:http://poj.org/problem?id=3261 这个是可以交叉的重复串,所以用height就可以了,但是题目说让重复k次以上,也就是直接做一个k-1长度的滑窗最小值,从这些最小 ...

  5. bzoj 2525 [Poi2011]Dynamite 二分+树形dp

    [Poi2011]Dynamite Time Limit: 30 Sec  Memory Limit: 128 MBSubmit: 270  Solved: 138[Submit][Status][D ...

  6. fuser命令找到占用资源的进程

    fuser 概述 fuser命令是用来显示所有正在使用着指定的file, file system 或者 sockets的进程信息. 例一: #fuser –m –u /mnt/usb1 /mnt/us ...

  7. html中offsetTop、clientTop、scrollTop、offsetTop各属性介绍(转载)

    HTML精确定位:scrollLeft,scrollWidth,clientWidth,offsetWidth scrollHeight: 获取对象的滚动高度. scrollLeft: 设置或获取位于 ...

  8. CSS3学习笔记之loading动画

    效果截图: HTML代码: <div class="divBox"> <div class="loader"> <div clas ...

  9. Lesson 3

    1.关于面向对象的三个重要属性  Encapsulation(封装):无法直接访问类的成员变量,而是通过一些get set方法,间接访问数据域: Polymorphism(多态):静态绑定,动态绑定, ...

  10. Drupal7所见即所得模块CKEditor

    初学Drupal(7.26),刚好遇到一个需要用到CKEditor模块的项目,于是就摸索着把它给装上了. 图片上传出问题 回到Drupal7的管理页面后刚好发现了对于CKEditor的“状态报告”(错 ...