hiho week 143 register

Ended

Participants:1650

Verdict:Accepted
Score:100 / 100
Submitted:2017-03-25 22:45:00

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;
int n,a[1010];
int main(){
    while(~scanf("%d",&n))
    {
        for(int i=0;i<n;i++)
        {
            scanf("%d",a+i);
        }
        int cnt=n;
        for(int i=n-1;i>0;i--)
        {
            cnt--;
            if(a[i]<a[i-1])
                break;  
        }
        for(int i=0;i<cnt;i++)
            printf(i==0?"%d":" %d",a[i]);
        puts("");
    }
    return 0;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX