hiho week 317 register

Ended

Participants:32

Verdict:Accepted
Score:100 / 100
Submitted:2020-07-29 16:12:55

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 <set>
#include <map>
#include <stack>
#include <queue>
#include <cmath>
#include <vector>
#include <string>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#define MAX(a,b) ((a)>=(b)?(a):(b))
#define MIN(a,b) ((a)<=(b)?(a):(b))
#define OO 0x0fffffff
using namespace std;
typedef long long LL;
set<int> sets;
int main(){
    int N,K,data; cin>>N>>K; K++;
    sets.insert(0); sets.insert(N+1);
    int ans = -2;
    bool finded = false;
    for(int i=0;i<N;i++){
        scanf("%d",&data);
        if(finded) continue;
        auto iter = sets.upper_bound(data);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX