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:29:34
2017-05-27 14:04:45
2017-05-27 14:01:28
2017-05-27 13:58:15
Task:Contest
Sender:Kanadan virallinen maajoukkue
Submission time:2017-05-27 14:29:34
Language:C++
Status:READY
Result:ACCEPTED

Test results

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

Code

#include<iostream>
#include<queue>
#include<stack>

using namespace std;

// BINÄÄRIHAU ILMAN ET VOI TESTAA
// #RIP
// #REKT
// #KUOLISAATANA

//ilmeeni kun servaan jonneja: 8)
int n;

int query(int inst, int mones){
    if(mones < 1)
        return 1000000001;
    if(mones>n)
        return 0;
    int temp;
    cout << inst << " " << mones << endl;
    cin>>temp;
    return temp;
}

int main(){
    int k;
    cin>>n>>k;
    
    int ala=0, yla=n;
    
    while(ala<yla){
        int kesk = (ala + yla) / 2;
        
        int i1 = kesk;
        int a1 = i1+1;
        
        int i2 = k-kesk;
        int a2 = i2+1;
        
        
        int pi1 = query(1,i1);
        int pa1 = query(1,a1);
        int pi2 = query(2,i2);
        int pa2 = query(2,a2);
        
        if(pa2>pi1){
            yla=kesk-1;
            continue;
        }
        
        if(pa1>pi2){
            ala=kesk+1;
            continue;
        }
        
        ala = kesk;
        break;
    }
    int i1 = ala;
    int i2 = k-i1;
    int pi1 = query(1, i1);
    int pi2 = query(2, i2);
    cout<<3<<" "<<min(pi1,pi2)<<endl;
    
    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
1 1
33
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
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
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
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
1 2
91
2 1
83
1 1
98
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
1 2
23
2 1
39
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
1 2
57
2 1
77
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
1 2
64
2 1
63
2 2
2
1 2
64
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
1 2
28
2 1
97
2 2
90
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
1 2
66
2 1
75
2 2
38
1 1
87
2 1
75
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 1
70
1 2
39
1 2
39
2 2
12
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 1
47
1 2
20
1 2
20
2 2
52
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 1
54
1 2
20
1 2
20
2 2
1
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 1
68
1 2
66
1 2
66
2 2
61
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 1
35
1 2
27
1 2
27
2 2
66
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 1
51
1 2
32
1 2
32
2 2
18
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 5
71
1 6
70
1 2
78
1 3
74
1 1
100
2 1
29
2 2
26
1 1
100
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 5
17
1 6
14
1 2
52
1 3
49
1 1
56
2 1
99
2 2
98
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 5
53
1 6
42
1 2
86
1 3
73
1 1
91
2 1
100
2 2
77
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 5
64
1 6
63
1 2
87
1 3
69
2 1
50
1 2
87
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 5
13
1 6
9
1 2
28
1 3
26
2 1
95
1 1
31
2 2
87
2 3
80
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 5
61
1 6
41
1 2
93
1 3
89
2 1
96
1 1
98
2 2
86
2 3
76
1 1
98
2 1
...
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
1 6
81
2 5
21
2 6
18
1 8
74
1 9
71
2 2
27
2 3
26
1 9
71
1 10
...
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
1 6
23
2 5
78
2 6
77
1 2
41
1 3
40
2 8
68
2 9
59
1 1
46
2 10
...
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
1 6
37
2 5
67
2 6
41
1 2
80
1 3
68
2 8
18
2 9
17
1 3
68
1 4
...
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 5
79
1 6
74
1 8
60
1 9
59
2 10
5
1 9
59
1 10
47
2 9
6
2 10
5
1 10
...
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 5
28
1 6
27
1 8
19
1 9
15
2 10
60
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 5
62
1 6
59
1 8
38
1 9
34
2 10
6
1 9
34
1 10
10
2 9
31
2 10
6
1 9
...
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 5
73
1 6
71
1 8
65
1 9
61
1 9
61
1 10
56
1 10
56
2 10
1
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 5
35
1 6
28
1 8
18
1 9
10
1 9
10
1 10
3
1 10
3
2 10
59
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 5
71
1 6
63
1 8
34
1 9
29
1 9
29
1 10
24
1 10
24
2 10
2
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 50000
750978379
1 50001
750971210
1 24999
874828382
1 25000
874825333
1 12499
937349950
1 12500
937342266
1 6249
968260442
1 6250
968256200
1 3124
984165193
1 3125
...
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 50000
248895192
1 50001
248886015
1 24999
373233338
1 25000
373227638
1 12499
435558130
1 12500
435557589
1 6249
467161805
1 6250
467161159
1 3124
482822309
1 3125
...
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 50000
502294656
1 50001
502279438
1 24999
749563812
1 25000
749558720
1 12499
876531480
1 12500
876529382
1 6249
938517855
1 6250
938510389
1 3124
969034862
1 3125
...
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 50000
750960645
1 50001
750951305
1 24999
875463070
1 25000
875460687
1 12499
937579630
1 12500
937576459
2 7501
462992982
2 7502
462988584
1 18749
907103711
1 18750
...
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 50000
251235286
1 50001
251230219
1 24999
376343255
1 25000
376312224
1 12499
438823280
1 12500
438807451
2 7501
962579104
2 7502
962575532
1 6249
470380988
1 6250
...
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 50000
502413016
1 50001
502394468
1 24999
751812882
1 25000
751796071
1 12499
875399177
1 12500
875396528
2 7501
924927108
2 7502
924924183
1 6249
937272534
1 6250
...
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
1 50001
750737881
2 50000
249323673
2 50001
249320531
1 75000
625515277
1 75001
625510290
2 25000
374706536
2 25001
374700500
1 87500
563173909
1 87501
...
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
1 50001
249815976
2 50000
750771880
2 50001
750767095
1 24999
375671453
1 25000
375669285
2 75001
625932184
2 75002
625926696
1 12499
437758759
1 12500
...
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
1 50001
499518038
2 50000
499176370
2 50001
499159178
1 75000
249058143
1 75001
249052081
2 25000
748266089
2 25001
748264263
1 62500
375103265
1 62501
...
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 50000
749050064
1 50001
749049335
1 75000
623658975
1 75001
623658310
1 87500
561931156
1 87501
561930275
2 92500
38062922
2 92501
38058132
1 93750
530826401
1 93751
...
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 50000
248438375
1 50001
248436700
1 75000
123497559
1 75001
123489608
1 87500
61253256
1 87501
61249595
2 92500
536762910
2 92501
536756243
1 81250
91911398
1 81251
...
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 50000
498880008
1 50001
498879770
1 75000
247968497
1 75001
247960227
1 87500
122903262
1 87501
122902604
2 92500
74404464
2 92501
74384469
1 93750
61500684
1 93751
...
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 50000
750286180
1 50001
750280831
1 75000
625760863
1 75001
625759167
1 87500
563233669
1 87501
563233429
1 93750
531424159
1 93751
531421361
1 96875
515882722
1 96876
...
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 50000
249934024
1 50001
249933515
1 75000
123751774
1 75001
123747894
1 87500
62097920
1 87501
62090222
1 93750
30713341
1 93751
30700745
1 96875
15168823
1 96876
...
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 50000
499227280
1 50001
499225902
1 75000
248484228
1 75001
248467525
1 87500
126074336
1 87501
126069317
1 93750
62776616
1 93751
62764435
1 96875
31834586
1 96876
...
view   save