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 15:42:47
2017-05-27 15:42:46
2017-05-27 15:35:29
2017-05-27 15:23:15
2017-05-27 14:55:18
2017-05-27 14:50:05
2017-05-27 12:59:43
2017-05-27 12:52:19
2017-05-27 12:44:55
Task:Contest
Sender:oispa opiskelupaikka tefyllä ;...;
Submission time:2017-05-27 15:42:47
Language:C++
Status:READY
Result:WRONG ANSWER

Test results

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

Code

#include <bits/stdc++.h>

using namespace std;
int n, k;
unordered_map<int, int> ad, ud;
int getA(int i){
    if(ad.count(i))
        return ad[i];
    cout << "1 " << i+1 << endl;
    cout.flush();
    int re; cin >> re;
    ad[i] = re;
    return re;
}

int getU(int i){
    if(ud.count(i))
        return ud[i];
    cout << "2 " << i+1 << endl;
    cout.flush();
    int re; cin >> re;
    ud[i] = re;
    return re;
}
bool dd = false;
bool endd = false;

int idxa(int lol){
    int cn = getA(lol);
    int i = -1;
    for(int bi = 1<<19; bi > 0; bi/=2){
        while(i+bi < n && cn > getU(i+bi))
            i+=bi;
    }
    return lol+(i+1);
}
void hae1(){
    int i = 0;
    for(int bi = 1<<19; bi > 0; bi/=2){
        while(i+bi < n && idxa(i+bi) <= k)
            i+=bi;
    }
    if(i == k){
        endd = 1;
        cout << "3 " << getA(i) << endl;
    }
}

int idxu(int lol){
    int cn = getU(lol);
    int i = -1;
    for(int bi = 1<<19; bi > 0; bi/=2){
        while(i+bi < n && cn > getA(i+bi))
            i+=bi;
    }
    return lol+(i+1);
}
void hae2(){
    if(endd)
        return;
    int i = 0;
    for(int bi = 1<<19; bi > 0; bi/=2){
        while(i+bi < n && idxu(i+bi) <= k)
            i+=bi;
    }
    if(i == k){
        endd = 1;
        cout << "3 " << getU(i) << endl;
    }
}



int main(){
    cin >> n >> k;
    k--;
    hae1();
    hae2();
    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
3 33
view   save

Test 2

Verdict: WRONG ANSWER

input
1 1
37
55
view   save

correct output
(no output)
view   save

user output
1 1
1 1
37
3 37
view   save

Test 3

Verdict: TIME LIMIT EXCEEDED

input
1 2
80
38
view   save

correct output
(no output)
view   save

user output
(no output)
view   save

Test 4

Verdict: TIME LIMIT EXCEEDED

input
1 2
29
48
view   save

correct output
(no output)
view   save

user output
(no output)
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 2
91
2 2
14
1 1
98
3 98
view   save

Test 6

Verdict: WRONG ANSWER

input
2 1
25 23
39 31
view   save

correct output
(no output)
view   save

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

Test 7

Verdict: WRONG ANSWER

input
2 1
73 57
77 32
view   save

correct output
(no output)
view   save

user output
2 1
1 2
57
2 2
32
1 1
73
3 73
view   save

Test 8

Verdict: WRONG ANSWER

input
2 2
77 64
63 2
view   save

correct output
(no output)
view   save

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

Test 9

Verdict: WRONG ANSWER

input
2 2
61 28
97 90
view   save

correct output
(no output)
view   save

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

Test 10

Verdict: WRONG ANSWER

input
2 2
87 66
75 38
view   save

correct output
(no output)
view   save

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

Test 11

Verdict: TIME LIMIT EXCEEDED

input
2 4
70 39
33 12
view   save

correct output
(no output)
view   save

user output
(no output)
view   save

Test 12

Verdict: TIME LIMIT EXCEEDED

input
2 4
47 20
67 52
view   save

correct output
(no output)
view   save

user output
(no output)
view   save

Test 13

Verdict: TIME LIMIT EXCEEDED

input
2 4
54 20
90 1
view   save

correct output
(no output)
view   save

user output
(no output)
view   save

Test 14

Verdict: TIME LIMIT EXCEEDED

input
2 4
68 66
64 61
view   save

correct output
(no output)
view   save

user output
(no output)
view   save

Test 15

Verdict: TIME LIMIT EXCEEDED

input
2 4
35 27
68 66
view   save

correct output
(no output)
view   save

user output
(no output)
view   save

Test 16

Verdict: TIME LIMIT EXCEEDED

input
2 4
51 32
25 18
view   save

correct output
(no output)
view   save

user output
(no output)
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 9
43
2 8
9
2 10
3
1 5
71
1 3
74
1 2
78
1 1
100
3 100
view   save

Test 18

Verdict: WRONG ANSWER

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 9
9
2 8
67
2 4
80
2 2
98
2 1
99
1 5
17
1 3
49
1 2
52
1 1
56
3 56
...
view   save

Test 19

Verdict: WRONG ANSWER

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 9
13
2 8
33
2 4
58
2 2
77
2 1
100
1 5
53
2 10
9
1 3
73
1 2
86
1 1
...
view   save

Test 20

Verdict: WRONG ANSWER

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 9
54
2 8
14
2 10
1
1 5
64
1 3
69
1 2
87
2 9
8
1 8
55
1 4
68
1 1
...
view   save

Test 21

Verdict: WRONG ANSWER

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 9
5
2 8
53
2 4
78
2 2
87
2 1
95
1 5
13
1 3
26
1 2
28
3 28
view   save

Test 22

Verdict: TIME LIMIT EXCEEDED

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
(no output)
view   save

Test 23

Verdict: WRONG ANSWER

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 9
71
2 8
13
2 10
4
1 5
82
1 3
85
1 2
86
2 9
11
1 8
74
1 4
84
1 1
...
view   save

Test 24

Verdict: WRONG ANSWER

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 9
8
2 8
68
2 4
85
2 2
94
2 1
100
1 10
4
3 4
view   save

Test 25

Verdict: WRONG ANSWER

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 9
7
2 8
18
2 4
71
2 2
95
2 1
100
1 10
1
3 1
view   save

Test 26

Verdict: TIME LIMIT EXCEEDED

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
(no output)
view   save

Test 27

Verdict: TIME LIMIT EXCEEDED

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
(no output)
view   save

Test 28

Verdict: TIME LIMIT EXCEEDED

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
(no output)
view   save

Test 29

Verdict: TIME LIMIT EXCEEDED

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
(no output)
view   save

Test 30

Verdict: TIME LIMIT EXCEEDED

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
(no output)
view   save

Test 31

Verdict: TIME LIMIT EXCEEDED

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
(no output)
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 65537
673553588
2 65536
172867921
2 98304
8051979
2 99328
3096037
2 99840
831773
2 99968
128940
2 100000
7564
1 32769
836805401
1 16385
918055130
1 8193
...
view   save

Test 33

Verdict: WRONG ANSWER

input
100000 1
498482877 498480230 498478078 ...
view   save

correct output
(no output)
view   save

user output
100000 1
1 65537
171785183
2 65536
669514162
2 32768
834157387
2 16384
916814175
2 8192
958717961
2 4096
979148455
2 2048
989801796
2 1024
994675439
2 512
997393349
2 256
...
view   save

Test 34

Verdict: WRONG ANSWER

input
100000 1
999986977 999979153 999972315 ...
view   save

correct output
(no output)
view   save

user output
100000 1
1 65537
344651117
2 65536
343267139
2 98304
17177172
2 99328
6500123
2 99840
1652611
2 99968
349363
2 100000
3440
1 32769
672589213
1 16385
836437063
1 8193
...
view   save

Test 35

Verdict: WRONG ANSWER

input
100000 20000
999990977 999974610 999971985 ...
view   save

correct output
(no output)
view   save

user output
100000 20000
1 65537
674178849
2 65536
172134979
2 98304
8540148
2 99328
3375385
2 99840
825451
2 99968
122490
2 100000
375
1 32769
836864905
1 16385
918807934
1 8193
...
view   save

Test 36

Verdict: WRONG ANSWER

input
100000 20000
501434689 501431546 501422578 ...
view   save

correct output
(no output)
view   save

user output
100000 20000
1 65537
172605568
2 65536
673497612
2 32768
836319737
2 16384
918239642
2 8192
959416025
2 4096
979500792
2 2048
990103518
2 1024
995069187
2 512
997542058
2 256
...
view   save

Test 37

Verdict: TIME LIMIT EXCEEDED

input
100000 20000
999995686 999994228 999993000 ...
view   save

correct output
(no output)
view   save

user output
(no output)
view   save

Test 38

Verdict: WRONG ANSWER

input
100000 100000
999992342 999991618 999988963 ...
view   save

correct output
(no output)
view   save

user output
100000 100000
1 65537
673489872
2 65536
171393059
2 98304
8133259
2 99328
3108202
2 99840
801605
2 99968
125601
2 100000
660
1 32769
836429438
1 16385
917771680
1 8193
...
view   save

Test 39

Verdict: WRONG ANSWER

input
100000 100000
500754694 500749114 500734428 ...
view   save

correct output
(no output)
view   save

user output
100000 100000
1 65537
172948003
2 65536
673316641
2 32768
837216337
2 16384
919088292
2 8192
959226227
2 4096
979838219
2 2048
989604771
2 1024
994723291
2 512
997385379
2 256
...
view   save

Test 40

Verdict: WRONG ANSWER

input
100000 100000
999988713 999962210 999939592 ...
view   save

correct output
(no output)
view   save

user output
100000 100000
1 65537
343755588
2 65536
344731553
2 32768
670871254
2 16384
835956063
2 8192
918030954
2 4096
958892887
2 2048
979151251
2 1024
989545676
2 512
994504415
2 256
...
view   save

Test 41

Verdict: TIME LIMIT EXCEEDED

input
100000 180000
999994001 999991970 999991811 ...
view   save

correct output
(no output)
view   save

user output
(no output)
view   save

Test 42

Verdict: TIME LIMIT EXCEEDED

input
100000 180000
499560736 499555703 499549265 ...
view   save

correct output
(no output)
view   save

user output
(no output)
view   save

Test 43

Verdict: TIME LIMIT EXCEEDED

input
100000 180000
999996507 999993660 999990414 ...
view   save

correct output
(no output)
view   save

user output
(no output)
view   save

Test 44

Verdict: TIME LIMIT EXCEEDED

input
100000 200000
999987384 999983480 999981446 ...
view   save

correct output
(no output)
view   save

user output
(no output)
view   save

Test 45

Verdict: TIME LIMIT EXCEEDED

input
100000 200000
500801844 500800718 500792295 ...
view   save

correct output
(no output)
view   save

user output
(no output)
view   save

Test 46

Verdict: TIME LIMIT EXCEEDED

input
100000 200000
999984710 999974756 999965175 ...
view   save

correct output
(no output)
view   save

user output
(no output)
view   save