hiho week 143 register

Ended

Participants:1650

Verdict:Accepted
Score:100 / 100
Submitted:2017-03-27 10:22:38

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
26
27
28
29
#include<iostream>
#include<sstream>
#include<stack>
using namespace std;
int n;
int main()
{
    cin>>n;
    int a[1010];
    for(int i=1;i<=n;i++){
        cin>>a[i];
        
        
    }
    for(int i=n-1;i>0;i--){
        if(a[i]>a[i+1]){
            for(int j=1;j<=i;j++){
                cout<<a[j];
                if(j!=i)
                cout<<" ";
            }
            return 0;
        }
         
        
    }
    cout<<a[1];
    return 0;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX