hiho week 208 register

Ended

Participants:101

Verdict:Accepted
Score:100 / 100
Submitted:2018-06-26 10:27:13

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
30
31
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
    int NUM;
    cin>>NUM; 
    vector<int> a;
    for(int i=0;i<NUM;i++)
    {
        int t;
        cin>>t;
        a.push_back(t);
    }
    vector<int> b=a;
    sort(a.begin(),a.end());
    int wx;
    int wd;
    for(int i=0;i<NUM;i++)
    {
        if(a[i]!=b[i])
        {
            wx=i;
            break;
        }
    }
    for(int i=NUM-1;i>=0;i--)
    {
        if(a[i]!=b[i])
        {
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX