zoukankan      html  css  js  c++  java
  • Codeforces Round #424 A(模拟)

     1 #include<cstdio>
     2 int n,a[100007];
     3 int main(){
     4     scanf("%d",&n);
     5     for(int i=1;i<=n;++i)scanf("%d",a+i);
     6     int L=1,R=n;
     7     while(L<n&&a[L]<a[L+1])++L;
     8     while(R>1&&a[R]<a[R-1])--R;
     9     for(int i=L+1;i<=R;++i)if(a[L]!=a[i])return puts("NO"),0;
    10     return puts("YES"),0;
    11 }
     1 #include <iostream>
     2 using namespace std;
     3 int N;
     4 int V[105];
     5 int main()
     6 {
     7     cin>>N;
     8     for(int i=1;i<=N;i++)cin>>V[i];
     9     int i=1;
    10     while(i<N&&V[i]<V[i+1])i++;
    11     while(i<N&&V[i]==V[i+1])i++;
    12     while(i<N&&V[i]>V[i+1])i++;
    13     if(i<N)cout<<"NO";
    14     else cout<<"YES";
    15     return 0;
    16 }
     1 #include<iostream>
     2 #include<cstdio>
     3 using namespace std;
     4 int n;
     5 int a[1001];
     6 int main()
     7 {
     8     scanf("%d",&n);
     9     for(int i=1;i<=n;i++)scanf("%d",a+i);
    10     int i=1;
    11     while(i+1<=n && a[i+1]>a[i])i++;
    12     while(i+1<=n && a[i+1]==a[i])i++;
    13     while(i+1<=n && a[i+1]<a[i])i++;
    14     if(i<n)printf("NO");else printf("YES");
    15     return 0;
    16 } 
     1 #include<bits/stdc++.h>
     2 using namespace std;
     3 
     4 int main()
     5 {
     6     int n;
     7     cin>>n;
     8     int arr[n];
     9     for(int i=0;i<n;i++)
    10         cin>>arr[i];
    11     int i=0;
    12     while(arr[i+1]>arr[i] && i+1<n)
    13         i++;
    14     while(arr[i]==arr[i+1] && i+1<n)
    15         i++;
    16     while(arr[i]>arr[i+1] && i+1<n)
    17         i++;
    18     if(i==n-1)
    19         cout<<"YES";
    20     else cout<<"NO";
    21 
    22 
    23 }
     1 #include <bits/stdc++.h>
     2 
     3 using namespace std;
     4 
     5 int a[102];
     6 int n;
     7 void sol(string s) {
     8     cout << s;
     9     exit(0);
    10 }
    11 int main() {
    12 #ifndef ONLINE_JUDGE
    13     freopen("CF.in", "r", stdin);
    14 #endif
    15     cin >> n;
    16     for (int i = 1; i <= n; ++i)cin >> a[i];
    17     int i=1;
    18     while(i+1<=n&&a[i]<a[i+1])++i;
    19     while(i+1<=n&&a[i]==a[i+1])++i;
    20     while(i+1<=n)
    21     {
    22         if(a[i]<=a[i+1])sol("NO");
    23         ++i;
    24     }sol("YES");
    25 }
  • 相关阅读:
    Kafka项目实战-用户日志上报实时统计之应用概述
    ElasticSearch实战-编码实践
    ElasticSearch实战-入门
    Django如何渲染markdown
    理解相似矩阵
    从向量空间的角度来理解方程组有无解的问题
    凸优化学习笔记(1)-基础概念
    Django如何与JQuery进行数据通信?
    JQuery学习笔记之属性与样式
    JQuery学习笔记之选择器
  • 原文地址:https://www.cnblogs.com/Roni-i/p/7164042.html
Copyright © 2011-2022 走看看