QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#94046 | #5471. Interactive Number Guessing | whatever# | AC ✓ | 6ms | 3516kb | C++23 | 545b | 2023-04-05 08:30:27 | 2023-04-05 08:30:29 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
int main() {
i64 cur = 1, sum = 0;
auto ask = [&] (i64 x) {
cout << "query " << x << endl;
int y;
cin >> y;
return y;
};
int lim = ask(0);
for(int i = 0; i < 18; i ++) {
int l = 0, r = 9, ans = -1;
while(l <= r) {
int mid = l + r >> 1;
if(ask(cur * mid) == lim + mid) {
ans = mid, l = mid + 1;
} else {
r = mid - 1;
}
}
sum += cur * (9 - ans);
cur *= 10;
}
cout << "answer " << sum << endl;
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 5ms
memory: 3428kb
input:
6 10 4 11 12 10 13 5 10 13 14 6 10 13 14 15 10 13 14 15 10 13 14 15 10 13 14 15 10 13 14 15 10 13 14 15 10 13 14 15 10 13 14 15 10 13 14 15 10 13 14 15 10 13 14 15 10 13 14 15 10 13 14 15 10 13 14 15 10 13 14 15
output:
query 0 query 4 query 7 query 5 query 6 query 40 query 70 query 80 query 400 query 700 query 800 query 900 query 4000 query 7000 query 8000 query 9000 query 40000 query 70000 query 80000 query 90000 query 400000 query 700000 query 800000 query 900000 query 4000000 query 7000000 query 8000000 query 9...
result:
ok correct
Test #2:
score: 0
Accepted
time: 0ms
memory: 3416kb
input:
89 93 87 85 84 90 91 83 93 87 94 95 93 96 97 89 93 87 94 86 93 96 79 84 81 89 93 87 94 86 93 96 97 89 84 90 91 92 93 87 94 86 84 90 91 92 84 90 91 83 84 90 82 93 96 97 89 93 69 94 95 75 72 89 84 81 89
output:
query 0 query 4 query 7 query 5 query 40 query 10 query 20 query 30 query 400 query 700 query 500 query 600 query 4000 query 7000 query 8000 query 9000 query 40000 query 70000 query 50000 query 60000 query 400000 query 700000 query 800000 query 4000000 query 1000000 query 0 query 40000000 query 7000...
result:
ok correct
Test #3:
score: 0
Accepted
time: 2ms
memory: 3380kb
input:
88 92 95 87 83 89 81 92 86 93 94 83 89 90 91 83 89 81 92 86 84 92 77 75 83 80 88 92 95 87 92 95 96 88 92 95 96 88 92 86 93 85 92 86 93 85 92 86 93 85 92 86 93 85 83 89 81 92 77 75 83 80 88
output:
query 0 query 4 query 7 query 8 query 40 query 10 query 20 query 400 query 700 query 500 query 600 query 4000 query 1000 query 2000 query 3000 query 40000 query 10000 query 20000 query 400000 query 700000 query 500000 query 4000000 query 7000000 query 5000000 query 40000000 query 10000000 query 0 qu...
result:
ok correct
Test #4:
score: 0
Accepted
time: 4ms
memory: 3472kb
input:
95 99 93 91 99 93 100 92 90 96 97 98 90 96 97 89 99 102 94 90 96 88 81 96 97 98 90 87 95 99 93 100 101 90 96 97 89 99 102 103 104 90 96 97 98 90 96 97 98 90 96 97 89 99 93 100 101 90 96 88 99 93 100 101 99 93 91
output:
query 0 query 4 query 7 query 5 query 40 query 70 query 50 query 60 query 400 query 100 query 200 query 300 query 4000 query 1000 query 2000 query 3000 query 40000 query 70000 query 80000 query 400000 query 100000 query 200000 query 4000000 query 1000000 query 2000000 query 3000000 query 40000000 qu...
result:
ok correct
Test #5:
score: 0
Accepted
time: 3ms
memory: 3516kb
input:
75 79 73 80 72 79 82 74 70 76 77 69 79 73 71 79 73 71 79 73 80 81 79 73 80 81 79 82 74 70 76 68 79 82 83 84 79 73 80 81 79 82 74 70 76 77 69 79 73 71 79 82 83 84 79 73 71 70 76 77 78 70 76 68
output:
query 0 query 4 query 7 query 5 query 6 query 40 query 70 query 80 query 400 query 100 query 200 query 300 query 4000 query 7000 query 5000 query 40000 query 70000 query 50000 query 400000 query 700000 query 500000 query 600000 query 4000000 query 7000000 query 5000000 query 6000000 query 40000000 q...
result:
ok correct
Test #6:
score: 0
Accepted
time: 1ms
memory: 3296kb
input:
78 82 85 77 82 76 83 75 73 79 80 72 82 76 74 82 85 86 87 73 79 80 81 82 76 83 84 73 79 80 72 82 85 77 73 79 71 73 79 80 81 82 76 74 82 85 77 82 76 83 75 82 85 86 87 64 79 80 81 73 70 78 82 85 77
output:
query 0 query 4 query 7 query 8 query 40 query 70 query 50 query 60 query 400 query 100 query 200 query 300 query 4000 query 7000 query 5000 query 40000 query 70000 query 80000 query 90000 query 400000 query 100000 query 200000 query 300000 query 4000000 query 7000000 query 5000000 query 6000000 que...
result:
ok correct
Test #7:
score: 0
Accepted
time: 4ms
memory: 3516kb
input:
62 57 63 64 56 66 60 67 59 66 60 67 59 66 69 70 71 66 60 58 57 63 64 65 57 63 64 65 66 69 70 62 66 69 70 62 66 69 70 62 66 69 70 71 66 60 67 68 66 69 61 66 60 67 68 66 69 52 57 54 62 66 60 67 59 66 60 67 59
output:
query 0 query 4 query 1 query 2 query 3 query 40 query 70 query 50 query 60 query 400 query 700 query 500 query 600 query 4000 query 7000 query 8000 query 9000 query 40000 query 70000 query 50000 query 400000 query 100000 query 200000 query 300000 query 4000000 query 1000000 query 2000000 query 3000...
result:
ok correct
Test #8:
score: 0
Accepted
time: 3ms
memory: 3364kb
input:
46 50 53 54 55 50 53 45 50 53 54 55 50 35 51 34 41 38 46 50 53 54 46 50 44 51 52 50 53 54 55 50 53 54 37 41 38 46 50 53 54 46 50 53 45 41 47 48 49 50 53 45 50 53 54 55 50 44 51 52 50 44 51 52 50 53 54 55
output:
query 0 query 4 query 7 query 8 query 9 query 40 query 70 query 80 query 400 query 700 query 800 query 900 query 4000 query 7000 query 5000 query 6000 query 40000 query 10000 query 0 query 400000 query 700000 query 800000 query 900000 query 4000000 query 7000000 query 5000000 query 6000000 query 400...
result:
ok correct
Test #9:
score: 0
Accepted
time: 4ms
memory: 3484kb
input:
89 93 87 94 95 93 87 94 95 84 90 91 83 93 96 88 84 90 91 92 84 90 91 92 93 87 94 95 84 90 82 93 96 97 89 93 96 88 93 96 88 84 90 91 92 84 90 91 83 84 90 82 84 90 91 92 84 90 91 83 93 87 94 86 84 90 82
output:
query 0 query 4 query 7 query 5 query 6 query 40 query 70 query 50 query 60 query 400 query 100 query 200 query 300 query 4000 query 7000 query 8000 query 40000 query 10000 query 20000 query 30000 query 400000 query 100000 query 200000 query 300000 query 4000000 query 7000000 query 5000000 query 600...
result:
ok correct
Test #10:
score: 0
Accepted
time: 0ms
memory: 3428kb
input:
63 67 70 71 72 67 61 68 69 67 70 62 67 70 62 67 61 68 60 67 70 71 45 49 46 63 58 55 63 58 64 56 67 70 71 72 58 64 65 66 67 61 68 69 67 70 71 63 67 61 68 69 58 64 65 57 67 70 71 63 67 70 71 63 67 61 68 69
output:
query 0 query 4 query 7 query 8 query 9 query 40 query 70 query 50 query 60 query 400 query 700 query 800 query 4000 query 7000 query 8000 query 40000 query 70000 query 50000 query 60000 query 400000 query 700000 query 800000 query 900000 query 4000000 query 1000000 query 0 query 40000000 query 1000...
result:
ok correct
Test #11:
score: 0
Accepted
time: 4ms
memory: 3484kb
input:
84 88 82 89 90 88 82 89 81 88 91 83 61 85 86 87 70 67 84 79 76 84 79 85 77 88 91 83 88 91 92 93 88 91 92 93 79 76 84 88 82 89 81 79 85 86 78 88 82 89 90 88 73 89 90 79 76 84 79 85 86 87 88 91 92 93
output:
query 0 query 4 query 7 query 5 query 6 query 40 query 70 query 50 query 60 query 400 query 700 query 800 query 4000 query 1000 query 2000 query 3000 query 40000 query 10000 query 0 query 400000 query 100000 query 0 query 4000000 query 1000000 query 2000000 query 40000000 query 70000000 query 800000...
result:
ok correct
Test #12:
score: 0
Accepted
time: 4ms
memory: 3476kb
input:
0 4 7 8 9 4 7 8 9 4 7 8 9 4 7 8 9 4 7 8 9 4 7 8 9 4 7 8 9 4 7 8 9 4 7 8 9 4 7 8 9 4 7 8 9 4 7 8 9 4 7 8 9 4 7 8 9 4 7 8 9 4 7 8 9 4 7 8 9 4 7 8 9
output:
query 0 query 4 query 7 query 8 query 9 query 40 query 70 query 80 query 90 query 400 query 700 query 800 query 900 query 4000 query 7000 query 8000 query 9000 query 40000 query 70000 query 80000 query 90000 query 400000 query 700000 query 800000 query 900000 query 4000000 query 7000000 query 800000...
result:
ok correct
Test #13:
score: 0
Accepted
time: 3ms
memory: 3472kb
input:
18 22 25 26 18 22 25 26 18 22 25 26 18 22 25 26 18 22 25 26 18 22 25 26 18 22 25 26 18 22 25 26 18 22 25 26 18 22 25 26 18 22 25 26 18 22 25 26 18 22 25 26 18 22 25 26 18 22 25 26 18 22 25 26 18 22 25 26 18 22 25 26 18
output:
query 0 query 4 query 7 query 8 query 9 query 40 query 70 query 80 query 90 query 400 query 700 query 800 query 900 query 4000 query 7000 query 8000 query 9000 query 40000 query 70000 query 80000 query 90000 query 400000 query 700000 query 800000 query 900000 query 4000000 query 7000000 query 800000...
result:
ok correct
Test #14:
score: 0
Accepted
time: 1ms
memory: 3324kb
input:
36 40 43 35 40 43 35 40 43 35 40 43 35 40 43 35 40 43 35 40 43 35 40 43 35 40 43 35 40 43 35 40 43 35 40 43 35 40 43 35 40 43 35 40 43 35 40 43 35 40 43 35 40 43 35
output:
query 0 query 4 query 7 query 8 query 40 query 70 query 80 query 400 query 700 query 800 query 4000 query 7000 query 8000 query 40000 query 70000 query 80000 query 400000 query 700000 query 800000 query 4000000 query 7000000 query 8000000 query 40000000 query 70000000 query 80000000 query 400000000 ...
result:
ok correct
Test #15:
score: 0
Accepted
time: 5ms
memory: 3380kb
input:
54 58 52 59 60 58 52 59 60 58 52 59 60 58 52 59 60 58 52 59 60 58 52 59 60 58 52 59 60 58 52 59 60 58 52 59 60 58 52 59 60 58 52 59 60 58 52 59 60 58 52 59 60 58 52 59 60 58 52 59 60 58 52 59 60 58 52 59 60 58 52 59 60
output:
query 0 query 4 query 7 query 5 query 6 query 40 query 70 query 50 query 60 query 400 query 700 query 500 query 600 query 4000 query 7000 query 5000 query 6000 query 40000 query 70000 query 50000 query 60000 query 400000 query 700000 query 500000 query 600000 query 4000000 query 7000000 query 500000...
result:
ok correct
Test #16:
score: 0
Accepted
time: 6ms
memory: 3360kb
input:
72 76 70 77 69 76 70 77 69 76 70 77 69 76 70 77 69 76 70 77 69 76 70 77 69 76 70 77 69 76 70 77 69 76 70 77 69 76 70 77 69 76 70 77 69 76 70 77 69 76 70 77 69 76 70 77 69 76 70 77 69 76 70 77 69 76 70 77 69 76 70 77 69
output:
query 0 query 4 query 7 query 5 query 6 query 40 query 70 query 50 query 60 query 400 query 700 query 500 query 600 query 4000 query 7000 query 5000 query 6000 query 40000 query 70000 query 50000 query 60000 query 400000 query 700000 query 500000 query 600000 query 4000000 query 7000000 query 500000...
result:
ok correct
Test #17:
score: 0
Accepted
time: 3ms
memory: 3292kb
input:
90 94 88 86 94 88 86 94 88 86 94 88 86 94 88 86 94 88 86 94 88 86 94 88 86 94 88 86 94 88 86 94 88 86 94 88 86 94 88 86 94 88 86 94 88 86 94 88 86 94 88 86 94 88 86
output:
query 0 query 4 query 7 query 5 query 40 query 70 query 50 query 400 query 700 query 500 query 4000 query 7000 query 5000 query 40000 query 70000 query 50000 query 400000 query 700000 query 500000 query 4000000 query 7000000 query 5000000 query 40000000 query 70000000 query 50000000 query 400000000 ...
result:
ok correct
Test #18:
score: 0
Accepted
time: 4ms
memory: 3516kb
input:
108 103 109 110 111 103 109 110 111 103 109 110 111 103 109 110 111 103 109 110 111 103 109 110 111 103 109 110 111 103 109 110 111 103 109 110 111 103 109 110 111 103 109 110 111 103 109 110 111 103 109 110 111 103 109 110 111 103 109 110 111 103 109 110 111 103 109 110 111 103 109 110 111
output:
query 0 query 4 query 1 query 2 query 3 query 40 query 10 query 20 query 30 query 400 query 100 query 200 query 300 query 4000 query 1000 query 2000 query 3000 query 40000 query 10000 query 20000 query 30000 query 400000 query 100000 query 200000 query 300000 query 4000000 query 1000000 query 200000...
result:
ok correct
Test #19:
score: 0
Accepted
time: 0ms
memory: 3420kb
input:
126 121 127 128 120 121 127 128 120 121 127 128 120 121 127 128 120 121 127 128 120 121 127 128 120 121 127 128 120 121 127 128 120 121 127 128 120 121 127 128 120 121 127 128 120 121 127 128 120 121 127 128 120 121 127 128 120 121 127 128 120 121 127 128 120 121 127 128 120 121 127 128 120
output:
query 0 query 4 query 1 query 2 query 3 query 40 query 10 query 20 query 30 query 400 query 100 query 200 query 300 query 4000 query 1000 query 2000 query 3000 query 40000 query 10000 query 20000 query 30000 query 400000 query 100000 query 200000 query 300000 query 4000000 query 1000000 query 200000...
result:
ok correct
Test #20:
score: 0
Accepted
time: 5ms
memory: 3364kb
input:
144 139 145 137 139 145 137 139 145 137 139 145 137 139 145 137 139 145 137 139 145 137 139 145 137 139 145 137 139 145 137 139 145 137 139 145 137 139 145 137 139 145 137 139 145 137 139 145 137 139 145 137 139 145 137
output:
query 0 query 4 query 1 query 2 query 40 query 10 query 20 query 400 query 100 query 200 query 4000 query 1000 query 2000 query 40000 query 10000 query 20000 query 400000 query 100000 query 200000 query 4000000 query 1000000 query 2000000 query 40000000 query 10000000 query 20000000 query 400000000 ...
result:
ok correct
Test #21:
score: 0
Accepted
time: 2ms
memory: 3380kb
input:
162 4 1 162 13 10 162 22 19 162 31 28 162 40 37 162 49 46 162 58 55 162 67 64 162 76 73 162 85 82 162 94 91 162 103 100 162 112 109 162 121 118 162 130 127 162 139 136 162 148 145 162 157 154 162
output:
query 0 query 4 query 1 query 0 query 40 query 10 query 0 query 400 query 100 query 0 query 4000 query 1000 query 0 query 40000 query 10000 query 0 query 400000 query 100000 query 0 query 4000000 query 1000000 query 0 query 40000000 query 10000000 query 0 query 400000000 query 100000000 query 0 quer...
result:
ok correct
Test #22:
score: 0
Accepted
time: 5ms
memory: 3324kb
input:
10 14 8 6 14 8 6 14 17 18 19 14 17 18 19 14 17 18 19 14 17 18 19 14 17 18 19 14 17 18 19 14 17 18 19 14 17 18 19 14 17 18 19 14 17 18 19 14 17 18 19 14 17 18 19 14 17 18 19 14 17 18 19 14 17 18 19 14 17 18 19
output:
query 0 query 4 query 7 query 5 query 40 query 70 query 50 query 400 query 700 query 800 query 900 query 4000 query 7000 query 8000 query 9000 query 40000 query 70000 query 80000 query 90000 query 400000 query 700000 query 800000 query 900000 query 4000000 query 7000000 query 8000000 query 9000000 q...
result:
ok correct
Test #23:
score: 0
Accepted
time: 1ms
memory: 3432kb
input:
15 1 16 17 18 10 7 15 19 22 23 24 19 22 23 24 19 22 23 24 19 22 23 24 19 22 23 24 19 22 23 24 19 22 23 24 19 22 23 24 19 22 23 24 19 22 23 24 19 22 23 24 19 22 23 24 19 22 23 24 19 22 23 24 19 22 23 24 19 22 23 24
output:
query 0 query 4 query 1 query 2 query 3 query 40 query 10 query 0 query 400 query 700 query 800 query 900 query 4000 query 7000 query 8000 query 9000 query 40000 query 70000 query 80000 query 90000 query 400000 query 700000 query 800000 query 900000 query 4000000 query 7000000 query 8000000 query 90...
result:
ok correct
Test #24:
score: 0
Accepted
time: 5ms
memory: 3336kb
input:
4 8 11 3 8 11 3 8 11 12 13 8 11 12 13 8 11 12 13 8 11 12 13 8 11 12 13 8 11 12 13 8 11 12 13 8 11 12 13 8 11 12 13 8 11 12 13 8 11 12 13 8 11 12 13 8 11 12 13 8 11 12 13 8 11 12 13 8 11 12 13
output:
query 0 query 4 query 7 query 8 query 40 query 70 query 80 query 400 query 700 query 800 query 900 query 4000 query 7000 query 8000 query 9000 query 40000 query 70000 query 80000 query 90000 query 400000 query 700000 query 800000 query 900000 query 4000000 query 7000000 query 8000000 query 9000000 q...
result:
ok correct
Test #25:
score: 0
Accepted
time: 3ms
memory: 3512kb
input:
9 4 10 11 3 13 16 8 13 16 17 18 13 16 17 18 13 16 17 18 13 16 17 18 13 16 17 18 13 16 17 18 13 16 17 18 13 16 17 18 13 16 17 18 13 16 17 18 13 16 17 18 13 16 17 18 13 16 17 18 13 16 17 18 13 16 17 18 13 16 17 18
output:
query 0 query 4 query 1 query 2 query 3 query 40 query 70 query 80 query 400 query 700 query 800 query 900 query 4000 query 7000 query 8000 query 9000 query 40000 query 70000 query 80000 query 90000 query 400000 query 700000 query 800000 query 900000 query 4000000 query 7000000 query 8000000 query 9...
result:
ok correct
Test #26:
score: 0
Accepted
time: 5ms
memory: 3428kb
input:
10 14 17 9 5 11 3 14 17 18 19 14 17 18 19 14 17 18 19 14 17 18 19 14 17 18 19 14 17 18 19 14 17 18 19 14 17 18 19 14 17 18 19 14 17 18 19 14 17 18 19 14 17 18 19 14 17 18 19 14 17 18 19 14 17 18 19 14 17 18 19
output:
query 0 query 4 query 7 query 8 query 40 query 10 query 20 query 400 query 700 query 800 query 900 query 4000 query 7000 query 8000 query 9000 query 40000 query 70000 query 80000 query 90000 query 400000 query 700000 query 800000 query 900000 query 4000000 query 7000000 query 8000000 query 9000000 q...
result:
ok correct