Task: | Contest |
Sender: | oispa opiskelupaikka tefyllä ;...; |
Submission time: | 2017-05-27 12:44:55 +0300 |
Language: | C++ |
Status: | READY |
Result: | WRONG ANSWER |
test | verdict | time | |
---|---|---|---|
#1 | WRONG ANSWER | 0.07 s | details |
#2 | WRONG ANSWER | 0.05 s | details |
#3 | WRONG ANSWER | 0.05 s | details |
#4 | WRONG ANSWER | 0.04 s | details |
#5 | WRONG ANSWER | 0.04 s | details |
#6 | WRONG ANSWER | 0.06 s | details |
#7 | WRONG ANSWER | 0.06 s | details |
#8 | WRONG ANSWER | 0.07 s | details |
#9 | WRONG ANSWER | 0.04 s | details |
#10 | WRONG ANSWER | 0.09 s | details |
#11 | WRONG ANSWER | 0.06 s | details |
#12 | WRONG ANSWER | 0.06 s | details |
#13 | WRONG ANSWER | 0.07 s | details |
#14 | WRONG ANSWER | 0.07 s | details |
#15 | WRONG ANSWER | 0.07 s | details |
#16 | WRONG ANSWER | 0.06 s | details |
#17 | WRONG ANSWER | 0.06 s | details |
#18 | WRONG ANSWER | 0.04 s | details |
#19 | WRONG ANSWER | 0.07 s | details |
#20 | WRONG ANSWER | 0.05 s | details |
#21 | WRONG ANSWER | 0.06 s | details |
#22 | WRONG ANSWER | 0.07 s | details |
#23 | WRONG ANSWER | 0.06 s | details |
#24 | WRONG ANSWER | 0.06 s | details |
#25 | WRONG ANSWER | 0.08 s | details |
#26 | WRONG ANSWER | 0.03 s | details |
#27 | WRONG ANSWER | 0.04 s | details |
#28 | WRONG ANSWER | 0.06 s | details |
#29 | WRONG ANSWER | 0.07 s | details |
#30 | WRONG ANSWER | 0.05 s | details |
#31 | WRONG ANSWER | 0.05 s | details |
#32 | WRONG ANSWER | 0.10 s | details |
#33 | WRONG ANSWER | 0.12 s | details |
#34 | WRONG ANSWER | 0.13 s | details |
#35 | WRONG ANSWER | 0.08 s | details |
#36 | WRONG ANSWER | 0.10 s | details |
#37 | WRONG ANSWER | 0.10 s | details |
#38 | WRONG ANSWER | 0.10 s | details |
#39 | WRONG ANSWER | 0.08 s | details |
#40 | WRONG ANSWER | 0.11 s | details |
#41 | WRONG ANSWER | 0.10 s | details |
#42 | WRONG ANSWER | 0.09 s | details |
#43 | WRONG ANSWER | 0.10 s | details |
#44 | WRONG ANSWER | 0.10 s | details |
#45 | WRONG ANSWER | 0.09 s | details |
#46 | WRONG ANSWER | 0.10 s | details |
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; } void hae(int a, int b, int l, int r){ // cout << "nyt " << a << "-" << b << " ja " << l << "-" << r << endl; int m = (a+b)/2; int i = -1; int an = getA(m); for(int bi = 1<<19; bi > 0; bi/=2){ while(i+bi < n && getU(i+bi) > an) i+=bi; } int mon = m+(i+1); cout << an << " on " << mon << " vs " << k << endl; if(mon == k){ cout << "3 " << an << endl; return; } if(mon < k) a = m+1; else b = m; int m2 = (a+b)/2; int i2 = -1; int an2 = getU(m); for(int bi = 1<<19; bi > 0; bi/=2){ while(i2+bi < n && getA(i2+bi) > an2) i2+=bi; } int mon2 = m2+(i2+1); //cout << an2 << " on " << mon2 << " vs " << k << endl; if(mon2 == k){ cout << "3 " << an2 << endl; return; } if(mon2 < k) l = m2+1; else r = m2; hae(a, b, l, r); } int main(){ cin >> n >> k; k--; hae(0, n, 0, n); return 0; }
Test details
Test 1
Verdict: WRONG ANSWER
input |
---|
1 1 33 18 |
correct output |
---|
(empty) |
user output |
---|
1 1 1 1 33 2 1 18 ... |
Test 2
Verdict: WRONG ANSWER
input |
---|
1 1 37 55 |
correct output |
---|
(empty) |
user output |
---|
1 1 1 1 37 2 1 55 ... |
Test 3
Verdict: WRONG ANSWER
input |
---|
1 2 80 38 |
correct output |
---|
(empty) |
user output |
---|
1 2 1 1 80 2 1 38 ... |
Test 4
Verdict: WRONG ANSWER
input |
---|
1 2 29 48 |
correct output |
---|
(empty) |
user output |
---|
1 2 1 1 29 2 1 48 ... |
Test 5
Verdict: WRONG ANSWER
input |
---|
2 1 98 91 83 14 |
correct output |
---|
(empty) |
user output |
---|
2 1 1 2 91 2 2 14 ... |
Test 6
Verdict: WRONG ANSWER
input |
---|
2 1 25 23 39 31 |
correct output |
---|
(empty) |
user output |
---|
2 1 1 2 23 2 2 31 ... |
Test 7
Verdict: WRONG ANSWER
input |
---|
2 1 73 57 77 32 |
correct output |
---|
(empty) |
user output |
---|
2 1 1 2 57 2 2 32 ... |
Test 8
Verdict: WRONG ANSWER
input |
---|
2 2 77 64 63 2 |
correct output |
---|
(empty) |
user output |
---|
2 2 1 2 64 2 2 2 ... |
Test 9
Verdict: WRONG ANSWER
input |
---|
2 2 61 28 97 90 |
correct output |
---|
(empty) |
user output |
---|
2 2 1 2 28 2 2 90 ... |
Test 10
Verdict: WRONG ANSWER
input |
---|
2 2 87 66 75 38 |
correct output |
---|
(empty) |
user output |
---|
2 2 1 2 66 2 2 38 ... |
Test 11
Verdict: WRONG ANSWER
input |
---|
2 4 70 39 33 12 |
correct output |
---|
(empty) |
user output |
---|
2 4 1 2 39 2 2 12 ... |
Test 12
Verdict: WRONG ANSWER
input |
---|
2 4 47 20 67 52 |
correct output |
---|
(empty) |
user output |
---|
2 4 1 2 20 2 2 52 ... |
Test 13
Verdict: WRONG ANSWER
input |
---|
2 4 54 20 90 1 |
correct output |
---|
(empty) |
user output |
---|
2 4 1 2 20 2 2 1 ... |
Test 14
Verdict: WRONG ANSWER
input |
---|
2 4 68 66 64 61 |
correct output |
---|
(empty) |
user output |
---|
2 4 1 2 66 2 2 61 ... |
Test 15
Verdict: WRONG ANSWER
input |
---|
2 4 35 27 68 66 |
correct output |
---|
(empty) |
user output |
---|
2 4 1 2 27 2 2 66 ... |
Test 16
Verdict: WRONG ANSWER
input |
---|
2 4 51 32 25 18 |
correct output |
---|
(empty) |
user output |
---|
2 4 1 2 32 2 2 18 ... |
Test 17
Verdict: WRONG ANSWER
input |
---|
10 1 100 78 74 72 71 70 64 57 43 39 29 26 22 21 15 13 11 9 4 3 |
correct output |
---|
(empty) |
user output |
---|
10 1 1 6 70 2 8 9 ... |
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 |
correct output |
---|
(empty) |
user output |
---|
10 1 1 6 14 2 8 67 ... |
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 |
correct output |
---|
(empty) |
user output |
---|
10 1 1 6 42 2 8 33 ... |
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 |
correct output |
---|
(empty) |
user output |
---|
10 2 1 6 63 2 8 14 ... |
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 |
correct output |
---|
(empty) |
user output |
---|
10 2 1 6 9 2 8 53 ... |
Test 22
Verdict: WRONG ANSWER
input |
---|
10 2 98 93 89 68 61 41 32 30 23 4 96 86 76 75 73 58 35 29 26 7 |
correct output |
---|
(empty) |
user output |
---|
10 2 1 6 41 2 8 29 ... |
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 |
correct output |
---|
(empty) |
user output |
---|
10 10 1 6 81 2 8 13 ... |
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 |
correct output |
---|
(empty) |
user output |
---|
10 10 1 6 23 2 8 68 ... |
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 |
correct output |
---|
(empty) |
user output |
---|
10 10 1 6 37 2 8 18 ... |
Test 26
Verdict: WRONG ANSWER
input |
---|
10 18 87 86 85 80 79 74 64 60 59 47 43 39 37 34 29 27 26 16 6 5 |
correct output |
---|
(empty) |
user output |
---|
10 18 1 6 74 2 8 16 ... |
Test 27
Verdict: WRONG ANSWER
input |
---|
10 18 54 48 42 38 28 27 22 19 15 5 100 96 91 84 79 73 72 64 63 60 |
correct output |
---|
(empty) |
user output |
---|
10 18 1 6 27 2 8 64 ... |
Test 28
Verdict: WRONG ANSWER
input |
---|
10 18 98 87 84 71 62 59 45 38 34 10 89 86 77 73 69 67 46 32 31 6 |
correct output |
---|
(empty) |
user output |
---|
10 18 1 6 59 2 8 32 ... |
Test 29
Verdict: WRONG ANSWER
input |
---|
10 20 91 90 86 79 73 71 67 65 61 56 46 44 36 25 18 11 6 5 3 1 |
correct output |
---|
(empty) |
user output |
---|
10 20 1 6 71 2 8 5 ... |
Test 30
Verdict: WRONG ANSWER
input |
---|
10 20 56 48 47 46 35 28 26 18 10 3 95 90 89 85 79 77 67 66 62 59 |
correct output |
---|
(empty) |
user output |
---|
10 20 1 6 28 2 8 66 ... |
Test 31
Verdict: WRONG ANSWER
input |
---|
10 20 81 80 79 76 71 63 57 34 29 24 96 70 61 59 52 36 22 5 4 2 |
correct output |
---|
(empty) |
user output |
---|
10 20 1 6 63 2 8 5 ... |
Test 32
Verdict: WRONG ANSWER
input |
---|
100000 1 999998453 999997813 999980598 ... |
correct output |
---|
(empty) |
user output |
---|
100000 1 1 50001 750971210 2 65536 172867921 ... Truncated |
Test 33
Verdict: WRONG ANSWER
input |
---|
100000 1 498482877 498480230 498478078 ... |
correct output |
---|
(empty) |
user output |
---|
100000 1 1 50001 248886015 2 65536 669514162 ... Truncated |
Test 34
Verdict: WRONG ANSWER
input |
---|
100000 1 999986977 999979153 999972315 ... |
correct output |
---|
(empty) |
user output |
---|
100000 1 1 50001 502279438 2 65536 343267139 ... Truncated |
Test 35
Verdict: WRONG ANSWER
input |
---|
100000 20000 999990977 999974610 999971985 ... |
correct output |
---|
(empty) |
user output |
---|
100000 20000 1 50001 750951305 2 65536 172134979 ... Truncated |
Test 36
Verdict: WRONG ANSWER
input |
---|
100000 20000 501434689 501431546 501422578 ... |
correct output |
---|
(empty) |
user output |
---|
100000 20000 1 50001 251230219 2 65536 673497612 ... Truncated |
Test 37
Verdict: WRONG ANSWER
input |
---|
100000 20000 999995686 999994228 999993000 ... |
correct output |
---|
(empty) |
user output |
---|
100000 20000 1 50001 502394468 2 65536 343948557 ... Truncated |
Test 38
Verdict: WRONG ANSWER
input |
---|
100000 100000 999992342 999991618 999988963 ... |
correct output |
---|
(empty) |
user output |
---|
100000 100000 1 50001 750737881 2 65536 171393059 ... Truncated |
Test 39
Verdict: WRONG ANSWER
input |
---|
100000 100000 500754694 500749114 500734428 ... |
correct output |
---|
(empty) |
user output |
---|
100000 100000 1 50001 249815976 2 65536 673316641 ... Truncated |
Test 40
Verdict: WRONG ANSWER
input |
---|
100000 100000 999988713 999962210 999939592 ... |
correct output |
---|
(empty) |
user output |
---|
100000 100000 1 50001 499518038 2 65536 344731553 ... Truncated |
Test 41
Verdict: WRONG ANSWER
input |
---|
100000 180000 999994001 999991970 999991811 ... |
correct output |
---|
(empty) |
user output |
---|
100000 180000 1 50001 749049335 2 65536 172781132 ... Truncated |
Test 42
Verdict: WRONG ANSWER
input |
---|
100000 180000 499560736 499555703 499549265 ... |
correct output |
---|
(empty) |
user output |
---|
100000 180000 1 50001 248436700 2 65536 671198604 ... Truncated |
Test 43
Verdict: WRONG ANSWER
input |
---|
100000 180000 999996507 999993660 999990414 ... |
correct output |
---|
(empty) |
user output |
---|
100000 180000 1 50001 498879770 2 65536 343216148 ... Truncated |
Test 44
Verdict: WRONG ANSWER
input |
---|
100000 200000 999987384 999983480 999981446 ... |
correct output |
---|
(empty) |
user output |
---|
100000 200000 1 50001 750280831 2 65536 171580123 ... Truncated |
Test 45
Verdict: WRONG ANSWER
input |
---|
100000 200000 500801844 500800718 500792295 ... |
correct output |
---|
(empty) |
user output |
---|
100000 200000 1 50001 249933515 2 65536 673446781 ... Truncated |
Test 46
Verdict: WRONG ANSWER
input |
---|
100000 200000 999984710 999974756 999965175 ... |
correct output |
---|
(empty) |
user output |
---|
100000 200000 1 50001 499225902 2 65536 344388330 ... Truncated |