Code Submission Evaluation System Login

HIIT Open 2017

Start:2017-05-27 11:00:00
End:2017-05-27 16:00:00
 

Tasks | Messages | Scoreboard | Statistics


CSES - HIIT Open 2017 - Results
History
2017-05-27 14:59:30
Task:Contest
Sender:KnowYourArchitecture
Submission time:2017-05-27 14:59:30
Language:C++
Status:READY
Result:ACCEPTED

Test results

testverdicttime (s)
#1ACCEPTED0.05 / 1.00details
#2ACCEPTED0.06 / 1.00details
#3ACCEPTED0.06 / 1.00details
#4ACCEPTED0.04 / 1.00details
#5ACCEPTED0.05 / 1.00details
#6ACCEPTED0.05 / 1.00details
#7ACCEPTED0.05 / 1.00details
#8ACCEPTED0.04 / 1.00details
#9ACCEPTED0.04 / 1.00details
#10ACCEPTED0.03 / 1.00details
#11ACCEPTED0.08 / 1.00details
#12ACCEPTED0.04 / 1.00details
#13ACCEPTED0.03 / 1.00details
#14ACCEPTED0.05 / 1.00details
#15ACCEPTED0.05 / 1.00details
#16ACCEPTED0.05 / 1.00details
#17ACCEPTED0.07 / 1.00details
#18ACCEPTED0.06 / 1.00details
#19ACCEPTED0.05 / 1.00details
#20ACCEPTED0.05 / 1.00details
#21ACCEPTED0.05 / 1.00details
#22ACCEPTED0.04 / 1.00details
#23ACCEPTED0.04 / 1.00details
#24ACCEPTED0.04 / 1.00details
#25ACCEPTED0.07 / 1.00details
#26ACCEPTED0.06 / 1.00details
#27ACCEPTED0.09 / 1.00details
#28ACCEPTED0.04 / 1.00details
#29ACCEPTED0.04 / 1.00details
#30ACCEPTED0.04 / 1.00details
#31ACCEPTED0.06 / 1.00details
#32ACCEPTED0.08 / 1.00details
#33ACCEPTED0.09 / 1.00details
#34ACCEPTED0.09 / 1.00details
#35ACCEPTED0.08 / 1.00details
#36ACCEPTED0.11 / 1.00details
#37ACCEPTED0.11 / 1.00details
#38ACCEPTED0.09 / 1.00details
#39ACCEPTED0.11 / 1.00details
#40ACCEPTED0.09 / 1.00details
#41ACCEPTED0.08 / 1.00details
#42ACCEPTED0.08 / 1.00details
#43ACCEPTED0.10 / 1.00details
#44ACCEPTED0.07 / 1.00details
#45ACCEPTED0.09 / 1.00details
#46ACCEPTED0.09 / 1.00details

Code

#include <bits/stdc++.h>

using namespace std;
int h[101010];
int a[101010];
int n,k;
int qa(int i){
    if(i<=0)return 1e9+7;
    if (i > n) return -1e9;
    if(a[i])return a[i];
    cout<<1<<' '<<i<<endl;
    cin>>a[i];
    return a[i];
}

int qh(int i){
    if(i<=0)return 1e9+7;
    if (i > n) return -1e9;
    if(h[i])return h[i];
    cout<<2<<' '<<i<<endl;
    cin>>h[i];
    return h[i];
}


int main() {
    cin>>n>>k;
    
    //for (int i = 1; i <= n; i++)
    //    cin >> h[i];
    //for (int i = 1; i <= n; i++)
    //    cin >> a[i];
    
    /*int sa = 1;
    int ea = k;
    while (sa < ea) {
        int ca = (sa+ea)/2;
        int ch = k-ca+1;
        if (qa(ca) < qh(ch)) sa = ca+1;
        else ea = ca;
    }*/
    int sa = 0;
    int ea = k;
    while (sa < ea) {
        int ca = (sa+ea+1)/2;
        int ch = k-ca;
        if (qa(ca) < qh(ch)) ea = ca-1;
        else sa = ca;
        //int ca = (sa+ea)/2;
        //int ch = k-ca;
        //if (qa(ca) > qh(ch)) ea = ca;
        //else sa = ca+1;
    }
    int boo = sa;
    sa = 0;
    ea = k;
    while (sa < ea) {
        int ca = (sa+ea+1)/2;
        int ch = k-ca;
        if (qa(ca) < qh(ch+1)) ea = ca-1;
        else sa = ca;
    }
    int foo = sa;
    //cout<<boo<<" "<<foo<<endl;
    
    if (boo >= foo)
        cout << "3 "<<qh(k-sa)<<endl;
    else
        cout << "3 "<<qa(sa)<<endl;
    /*for (int ca = k; ca >= 0; ca--) {
        int ch = k-ca;
        //cout<<ca<<":"<<qa(ca)<<" "<<ch<<":"<<qh(ch)<<endl;
        if (qa(ca) > qh(ch)) {
            cout << "Boo"<<qh(ch)<<endl;
            return 0;
        }
        //cout<<ca<<":"<<qa(ca)<<" "<<ch<<":"<<qh(ch+1)<<endl;
        if (qa(ca) > qh(ch+1)) {
            cout << "Foo"<<qa(ca)<<endl;
            return 0;
        }
    }*/
    
    //if (
    
    
    //cout << sa << " " << k-sa+1 << endl;
    
    /*int sa = 1;
    int ea = n;
    while (sa < ea) {
        int ca = (sa+ea)/2;
        int sh = 1;
        int eh = n;
        while (sh < eh) {
            int ch = (sh+eh+1)/2;
            if (qa(ca) < qh(ch)) sh = ch;
            else eh = ch-1;
        }
        if (ca+sh >= k) ea=ca;
        else sa=ca+1;
    }
    int ca = ea;
    int sh = 1;
    int eh = n;
    int ch = -1;
    while (sh < eh) {
        ch = (sh+eh+1)/2;
        if (qa(ca) < qh(ch)) sh = ch;
        else eh = ch-1;
    }
    cout << sa << " " << sh << endl;*/
    
    return 0;
    /*
    int sa=0,ea=n+1;
    int sh=0,eh=n+1;
    while(sa<ea){
        int ca=(sa+ea)/2;
        sh=0,eh=n+1;
        while(sh<eh){
            int ch=(sh+eh)/2;
            if(qa(ca)<qh(ch))sh=ch+1;
            else eh=ch;
        }
        std::cerr<<"db:"<<sh<<' '<<eh<<' '<<ca<<'\n';
        if(ca+sh > k)ea=ca;
        else sa=ca+1;
    }
    sh=0,eh=n+1;
    while(sh<eh){
        int ch=(sh+eh)/2;
        if(qa(sa)<qh(ch))sh=ch+1;
        else eh=ch;
    }
    cout<<sa<<' '<<sh<<'\n';
    return 0;*/
}

Test details

Test 1

Verdict: ACCEPTED

input
1 1
33
18
view   save

correct output
(no output)
view   save

user output
1 1
1 1
33
2 1
18
3 33
view   save

Test 2

Verdict: ACCEPTED

input
1 1
37
55
view   save

correct output
(no output)
view   save

user output
1 1
1 1
37
2 1
55
3 55
view   save

Test 3

Verdict: ACCEPTED

input
1 2
80
38
view   save

correct output
(no output)
view   save

user output
1 2
1 1
80
2 1
38
3 38
view   save

Test 4

Verdict: ACCEPTED

input
1 2
29
48
view   save

correct output
(no output)
view   save

user output
1 2
1 1
29
2 1
48
3 29
view   save

Test 5

Verdict: ACCEPTED

input
2 1
98 91
83 14
view   save

correct output
(no output)
view   save

user output
2 1
1 1
98
2 1
83
3 98
view   save

Test 6

Verdict: ACCEPTED

input
2 1
25 23
39 31
view   save

correct output
(no output)
view   save

user output
2 1
1 1
25
2 1
39
3 39
view   save

Test 7

Verdict: ACCEPTED

input
2 1
73 57
77 32
view   save

correct output
(no output)
view   save

user output
2 1
1 1
73
2 1
77
3 77
view   save

Test 8

Verdict: ACCEPTED

input
2 2
77 64
63 2
view   save

correct output
(no output)
view   save

user output
2 2
1 1
77
2 1
63
1 2
64
2 2
2
3 64
view   save

Test 9

Verdict: ACCEPTED

input
2 2
61 28
97 90
view   save

correct output
(no output)
view   save

user output
2 2
1 1
61
2 1
97
2 2
90
3 90
view   save

Test 10

Verdict: ACCEPTED

input
2 2
87 66
75 38
view   save

correct output
(no output)
view   save

user output
2 2
1 1
87
2 1
75
1 2
66
2 2
38
3 75
view   save

Test 11

Verdict: ACCEPTED

input
2 4
70 39
33 12
view   save

correct output
(no output)
view   save

user output
2 4
1 2
39
2 2
12
2 1
33
3 12
view   save

Test 12

Verdict: ACCEPTED

input
2 4
47 20
67 52
view   save

correct output
(no output)
view   save

user output
2 4
1 2
20
2 2
52
1 1
47
3 20
view   save

Test 13

Verdict: ACCEPTED

input
2 4
54 20
90 1
view   save

correct output
(no output)
view   save

user output
2 4
1 2
20
2 2
1
2 1
90
3 1
view   save

Test 14

Verdict: ACCEPTED

input
2 4
68 66
64 61
view   save

correct output
(no output)
view   save

user output
2 4
1 2
66
2 2
61
2 1
64
3 61
view   save

Test 15

Verdict: ACCEPTED

input
2 4
35 27
68 66
view   save

correct output
(no output)
view   save

user output
2 4
1 2
27
2 2
66
1 1
35
3 27
view   save

Test 16

Verdict: ACCEPTED

input
2 4
51 32
25 18
view   save

correct output
(no output)
view   save

user output
2 4
1 2
32
2 2
18
2 1
25
3 18
view   save

Test 17

Verdict: ACCEPTED

input
10 1
100 78 74 72 71 70 64 57 43 39
29 26 22 21 15 13 11 9 4 3
view   save

correct output
(no output)
view   save

user output
10 1
1 1
100
2 1
29
3 100
view   save

Test 18

Verdict: ACCEPTED

input
10 1
56 52 49 48 17 14 13 12 9 3
99 98 84 80 78 75 69 67 66 62
view   save

correct output
(no output)
view   save

user output
10 1
1 1
56
2 1
99
3 99
view   save

Test 19

Verdict: ACCEPTED

input
10 1
91 86 73 65 53 42 28 14 13 6
100 77 70 58 52 41 35 33 17 9
view   save

correct output
(no output)
view   save

user output
10 1
1 1
91
2 1
100
3 100
view   save

Test 20

Verdict: ACCEPTED

input
10 2
88 87 69 68 64 63 57 55 54 51
50 36 35 31 27 22 15 14 8 1
view   save

correct output
(no output)
view   save

user output
10 2
1 1
88
2 1
50
1 2
87
2 2
36
3 87
view   save

Test 21

Verdict: ACCEPTED

input
10 2
31 28 26 16 13 9 8 6 5 2
95 87 80 78 76 65 59 53 41 40
view   save

correct output
(no output)
view   save

user output
10 2
1 1
31
2 1
95
2 2
87
3 87
view   save

Test 22

Verdict: ACCEPTED

input
10 2
98 93 89 68 61 41 32 30 23 4
96 86 76 75 73 58 35 29 26 7
view   save

correct output
(no output)
view   save

user output
10 2
1 1
98
2 1
96
1 2
93
2 2
86
3 96
view   save

Test 23

Verdict: ACCEPTED

input
10 10
99 86 85 84 82 81 77 74 71 69
45 27 26 24 21 18 15 13 11 4
view   save

correct output
(no output)
view   save

user output
10 10
1 5
82
2 5
21
1 8
74
2 2
27
1 9
71
2 1
45
1 10
69
2 6
18
2 3
26
3 69
...
view   save

Test 24

Verdict: ACCEPTED

input
10 10
46 41 40 28 24 23 18 14 8 4
100 94 90 85 78 77 75 68 59 54
view   save

correct output
(no output)
view   save

user output
10 10
1 5
24
2 5
78
1 2
41
2 8
68
1 1
46
2 9
59
2 6
77
2 10
54
3 54
view   save

Test 25

Verdict: ACCEPTED

input
10 10
91 80 68 39 38 37 31 30 7 1
100 95 87 71 67 41 33 18 17 11
view   save

correct output
(no output)
view   save

user output
10 10
1 5
38
2 5
67
1 2
80
2 8
18
1 3
68
2 7
33
1 4
39
2 6
41
2 9
17
3 39
...
view   save

Test 26

Verdict: ACCEPTED

input
10 18
87 86 85 80 79 74 64 60 59 47
43 39 37 34 29 27 26 16 6 5
view   save

correct output
(no output)
view   save

user output
10 18
1 9
59
2 9
6
2 4
34
2 7
26
1 10
47
2 8
16
2 10
5
2 5
29
3 16
view   save

Test 27

Verdict: ACCEPTED

input
10 18
54 48 42 38 28 27 22 19 15 5
100 96 91 84 79 73 72 64 63 60
view   save

correct output
(no output)
view   save

user output
10 18
1 9
15
2 9
63
1 4
38
1 6
27
1 7
22
1 8
19
2 10
60
3 19
view   save

Test 28

Verdict: ACCEPTED

input
10 18
98 87 84 71 62 59 45 38 34 10
89 86 77 73 69 67 46 32 31 6
view   save

correct output
(no output)
view   save

user output
10 18
1 9
34
2 9
31
2 4
73
2 7
46
1 10
10
2 8
32
2 10
6
2 5
69
3 31
view   save

Test 29

Verdict: ACCEPTED

input
10 20
91 90 86 79 73 71 67 65 61 56
46 44 36 25 18 11 6 5 3 1
view   save

correct output
(no output)
view   save

user output
10 20
1 10
56
2 10
1
2 5
18
2 8
5
2 9
3
2 6
11
3 1
view   save

Test 30

Verdict: ACCEPTED

input
10 20
56 48 47 46 35 28 26 18 10 3
95 90 89 85 79 77 67 66 62 59
view   save

correct output
(no output)
view   save

user output
10 20
1 10
3
2 10
59
1 5
35
1 7
26
1 8
18
1 9
10
2 6
77
2 9
62
3 3
view   save

Test 31

Verdict: ACCEPTED

input
10 20
81 80 79 76 71 63 57 34 29 24
96 70 61 59 52 36 22 5 4 2
view   save

correct output
(no output)
view   save

user output
10 20
1 10
24
2 10
2
2 5
52
2 8
5
2 9
4
2 6
36
3 2
view   save

Test 32

Verdict: ACCEPTED

input
100000 1
999998453 999997813 999980598 ...
view   save

correct output
(no output)
view   save

user output
100000 1
1 1
999998453
2 1
501385639
3 999998453
view   save

Test 33

Verdict: ACCEPTED

input
100000 1
498482877 498480230 498478078 ...
view   save

correct output
(no output)
view   save

user output
100000 1
1 1
498482877
2 1
999998503
3 999998503
view   save

Test 34

Verdict: ACCEPTED

input
100000 1
999986977 999979153 999972315 ...
view   save

correct output
(no output)
view   save

user output
100000 1
1 1
999986977
2 1
999999598
3 999999598
view   save

Test 35

Verdict: ACCEPTED

input
100000 20000
999990977 999974610 999971985 ...
view   save

correct output
(no output)
view   save

user output
100000 20000
1 10000
950169971
2 10000
451028277
1 15000
925418578
2 5000
475234851
1 17500
913244441
2 2500
487813391
1 18750
907101094
2 1250
493968371
1 19375
904009556
2 625
...
view   save

Test 36

Verdict: ACCEPTED

input
100000 20000
501434689 501431546 501422578 ...
view   save

correct output
(no output)
view   save

user output
100000 20000
1 10000
451341105
2 10000
950469656
1 5000
476848791
2 15000
925225532
1 2500
488881666
2 17500
912299705
1 1250
495069372
2 18750
906005929
1 625
498368266
2 19375
...
view   save

Test 37

Verdict: ACCEPTED

input
100000 20000
999995686 999994228 999993000 ...
view   save

correct output
(no output)
view   save

user output
100000 20000
1 10000
900678332
2 10000
899674635
1 15000
849946246
2 5000
949740756
1 12500
875396528
2 7500
924929459
1 11250
887857017
2 8750
912390878
1 10625
894236334
2 9375
...
view   save

Test 38

Verdict: ACCEPTED

input
100000 100000
999992342 999991618 999988963 ...
view   save

correct output
(no output)
view   save

user output
100000 100000
1 50000
750743799
2 50000
249323673
1 75000
625515277
2 25000
374706536
1 87500
563173909
2 12500
438051434
1 93750
531491923
2 6250
469360554
1 96875
515984762
2 3125
...
view   save

Test 39

Verdict: ACCEPTED

input
100000 100000
500754694 500749114 500734428 ...
view   save

correct output
(no output)
view   save

user output
100000 100000
1 50000
249818189
2 50000
750771880
1 25000
375669285
2 75000
625932194
1 12500
437757417
2 87500
563051829
1 6250
468735385
2 93750
531749009
1 3125
484761011
2 96875
...
view   save

Test 40

Verdict: ACCEPTED

input
100000 100000
999988713 999962210 999939592 ...
view   save

correct output
(no output)
view   save

user output
100000 100000
1 50000
499530532
2 50000
499176370
1 75000
249058143
2 25000
748266089
1 62500
375103265
2 37500
623501116
1 56250
436718042
2 43750
561558980
1 53125
467956917
2 46875
...
view   save

Test 41

Verdict: ACCEPTED

input
100000 180000
999994001 999991970 999991811 ...
view   save

correct output
(no output)
view   save

user output
100000 180000
1 90000
549258882
2 90000
50126530
2 45000
275219847
2 67500
162964355
2 78750
106709902
1 95625
521694530
2 84375
78070487
1 98437
507966161
2 81563
92278630
1 99843
...
view   save

Test 42

Verdict: ACCEPTED

input
100000 180000
499560736 499555703 499549265 ...
view   save

correct output
(no output)
view   save

user output
100000 180000
1 90000
48927497
2 90000
548853417
1 45000
273571662
1 67500
161120949
1 78750
104377080
1 84375
76240047
2 95625
521153413
1 81562
90356683
2 98438
507485533
1 80156
...
view   save

Test 43

Verdict: ACCEPTED

input
100000 180000
999996507 999993660 999990414 ...
view   save

correct output
(no output)
view   save

user output
100000 180000
1 90000
97972596
2 90000
98995321
1 45000
549135314
1 67500
322848967
1 78750
210599864
1 84375
154125204
2 95625
43947296
1 87187
125667839
2 92813
71255139
1 88593
...
view   save

Test 44

Verdict: ACCEPTED

input
100000 200000
999987384 999983480 999981446 ...
view   save

correct output
(no output)
view   save

user output
100000 200000
1 100000
499647604
2 100000
16029
2 50000
249438491
2 75000
124646288
2 87500
62396132
2 93750
30695276
2 96875
15385411
2 98438
7720373
2 99219
3989925
2 99610
...
view   save

Test 45

Verdict: ACCEPTED

input
100000 200000
500801844 500800718 500792295 ...
view   save

correct output
(no output)
view   save

user output
100000 200000
1 100000
8183
2 100000
500805123
1 50000
249934024
1 75000
123751774
1 87500
62097920
1 93750
30713341
1 96875
15168823
1 98437
7578859
1 99218
3771826
1 99609
...
view   save

Test 46

Verdict: ACCEPTED

input
100000 200000
999984710 999974756 999965175 ...
view   save

correct output
(no output)
view   save

user output
100000 200000
1 100000
13769
2 100000
2005
2 50000
501418021
2 75000
250015635
2 87500
124972977
2 93750
62487827
2 96875
31129731
2 98438
15405481
2 99219
7911155
2 99610
...
view   save