QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#304954 | #5471. Interactive Number Guessing | SultanAA | WA | 1ms | 3760kb | C++20 | 921b | 2024-01-14 07:54:33 | 2024-01-14 07:54:34 |
Judging History
answer
#include <bits/stdc++.h>
#define uset unordered_set
using namespace std;
int main() {
int d;
cout << "query 0\n";
cout.flush(); cin >> d;
string ans = "";
if (d == 0) {cout << 0; return d;}
for (int digit = 0; digit <= 17; digit++) {
int l = 1, r = 10;
while(r >= l) {
int mid = (l+r)/2;
if (mid == 10 && digit == 17) {l = 10; break;}
int digitsum;
cout << "query " << mid << string(digit, '0') << "\n"; cout.flush();
cin >> digitsum;
if (digitsum > d) l = mid+1;
if (digitsum <= d) r = mid-1;
}
// cout << l << " " << r << "\n";
ans.push_back(10 - min(l,10) + '0');
}
cout << "answer ";
reverse(ans.begin(), ans.end());
bool number = false;
for (char c : ans) {
if (c != '0' || number) {
number = true; cout << c;
}
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3584kb
input:
6 11 5 12 4 11 5 12 13 11 14 6 11 14 15 7 11 14 15 7 11 14 15 7 11 14 15 7 11 14 15 7 11 14 15 7 11 14 15 7 11 14 15 7 11 14 15 7 11 14 15 7 11 14 15 7 11 14 15 7 11 14 15 7 11 14 15 7 11 14 15
output:
query 0 query 5 query 8 query 6 query 7 query 50 query 80 query 60 query 70 query 500 query 800 query 900 query 5000 query 8000 query 9000 query 10000 query 50000 query 80000 query 90000 query 100000 query 500000 query 800000 query 900000 query 1000000 query 5000000 query 8000000 query 9000000 query...
result:
ok correct
Test #2:
score: 0
Accepted
time: 1ms
memory: 3584kb
input:
89 85 91 92 93 85 91 83 94 88 95 87 94 97 89 94 88 86 94 79 95 96 85 82 81 94 88 86 94 97 89 85 91 92 84 94 88 86 85 91 92 84 85 91 83 85 82 90 94 97 89 94 70 95 69 76 73 72 85 82 81
output:
query 0 query 5 query 2 query 3 query 4 query 50 query 20 query 30 query 500 query 800 query 600 query 700 query 5000 query 8000 query 9000 query 50000 query 80000 query 60000 query 500000 query 800000 query 600000 query 700000 query 5000000 query 2000000 query 1000000 query 50000000 query 80000000 ...
result:
ok correct
Test #3:
score: 0
Accepted
time: 1ms
memory: 3600kb
input:
88 93 87 94 95 84 81 89 93 87 94 86 84 90 91 83 84 81 89 84 90 91 92 75 90 91 92 84 81 80 93 87 94 95 93 96 88 93 96 88 93 87 85 93 87 85 93 87 85 93 87 85 84 81 89 75 90 91 92 84 81 80
output:
query 0 query 5 query 8 query 6 query 7 query 50 query 20 query 10 query 500 query 800 query 600 query 700 query 5000 query 2000 query 3000 query 4000 query 50000 query 20000 query 10000 query 500000 query 200000 query 300000 query 400000 query 5000000 query 2000000 query 3000000 query 4000000 query...
result:
ok correct
Test #4:
score: 0
Accepted
time: 1ms
memory: 3584kb
input:
95 91 97 98 99 100 94 92 91 97 98 90 91 97 89 100 94 101 102 91 88 96 82 97 98 81 91 88 87 100 94 101 93 91 97 89 100 103 104 96 91 97 98 90 91 97 98 90 91 97 89 100 94 101 93 91 88 96 100 94 101 93 91 97 98 99
output:
query 0 query 5 query 2 query 3 query 4 query 50 query 80 query 60 query 500 query 200 query 300 query 400 query 5000 query 2000 query 3000 query 50000 query 80000 query 60000 query 70000 query 500000 query 200000 query 100000 query 5000000 query 2000000 query 3000000 query 4000000 query 50000000 qu...
result:
ok correct
Test #5:
score: 0
Accepted
time: 0ms
memory: 3460kb
input:
75 80 74 72 80 74 81 82 71 77 69 71 77 78 79 71 77 78 79 80 74 81 73 80 74 81 73 80 74 81 82 71 68 76 80 83 84 76 80 74 81 73 80 74 81 82 71 77 69 71 77 78 79 80 83 84 76 71 77 78 79 71 77 78 70 71 68 76
output:
query 0 query 5 query 8 query 6 query 50 query 80 query 60 query 70 query 500 query 200 query 300 query 5000 query 2000 query 3000 query 4000 query 50000 query 20000 query 30000 query 40000 query 500000 query 800000 query 600000 query 700000 query 5000000 query 8000000 query 6000000 query 7000000 qu...
result:
ok correct
Test #6:
score: 0
Accepted
time: 1ms
memory: 3532kb
input:
78 83 77 84 85 83 77 75 74 80 72 74 80 81 82 83 86 87 79 74 80 81 73 83 77 84 76 74 80 72 83 77 84 85 74 71 79 74 80 81 73 74 80 81 82 83 77 84 85 83 77 75 83 86 87 79 65 80 81 64 74 71 70 83 77 84 85
output:
query 0 query 5 query 8 query 6 query 7 query 50 query 80 query 60 query 500 query 200 query 300 query 5000 query 2000 query 3000 query 4000 query 50000 query 80000 query 90000 query 100000 query 500000 query 200000 query 300000 query 400000 query 5000000 query 8000000 query 6000000 query 7000000 qu...
result:
ok correct
Test #7:
score: 0
Accepted
time: 1ms
memory: 3584kb
input:
62 58 64 56 67 61 59 67 61 59 67 70 71 63 58 64 65 66 58 64 65 57 58 64 65 57 67 70 62 67 70 62 67 70 62 67 70 71 63 67 61 68 60 67 61 68 69 67 61 68 60 67 52 68 69 58 55 54 67 61 59 67 61 59
output:
query 0 query 5 query 2 query 3 query 50 query 80 query 60 query 500 query 800 query 600 query 5000 query 8000 query 9000 query 10000 query 50000 query 20000 query 30000 query 40000 query 500000 query 200000 query 300000 query 400000 query 5000000 query 2000000 query 3000000 query 4000000 query 5000...
result:
ok correct
Test #8:
score: 0
Accepted
time: 0ms
memory: 3760kb
input:
46 51 54 55 47 51 45 52 53 51 54 55 47 51 36 34 42 39 38 51 54 46 51 45 52 44 51 54 55 47 51 54 37 42 39 38 51 54 46 51 45 52 53 42 48 49 41 51 45 52 53 51 54 55 47 51 45 52 44 51 45 52 44 51 54 55
output:
query 0 query 5 query 8 query 9 query 10 query 50 query 80 query 60 query 70 query 500 query 800 query 900 query 1000 query 5000 query 8000 query 6000 query 50000 query 20000 query 10000 query 500000 query 800000 query 900000 query 5000000 query 8000000 query 6000000 query 7000000 query 50000000 que...
result:
ok correct
Test #9:
score: 0
Accepted
time: 1ms
memory: 3740kb
input:
89 94 88 95 87 94 88 95 87 85 91 83 94 88 95 96 85 91 92 84 85 91 92 84 94 88 95 87 85 82 90 94 97 89 94 88 95 96 94 88 95 96 85 91 92 84 85 91 83 85 82 90 85 91 92 84 85 91 83 94 88 86 85 82 90
output:
query 0 query 5 query 8 query 6 query 7 query 50 query 80 query 60 query 70 query 500 query 200 query 300 query 5000 query 8000 query 6000 query 7000 query 50000 query 20000 query 30000 query 40000 query 500000 query 200000 query 300000 query 400000 query 5000000 query 8000000 query 6000000 query 70...
result:
ok correct
Test #10:
score: 0
Accepted
time: 1ms
memory: 3528kb
input:
63 68 71 72 64 68 62 69 61 68 62 69 70 68 62 69 70 68 62 60 68 71 45 50 47 46 59 56 55 59 56 64 68 71 72 64 59 65 66 58 68 62 69 61 68 71 63 68 62 69 61 59 65 57 68 71 63 68 71 63 68 62 69 61
output:
query 0 query 5 query 8 query 9 query 10 query 50 query 80 query 60 query 70 query 500 query 800 query 600 query 700 query 5000 query 8000 query 6000 query 7000 query 50000 query 80000 query 60000 query 500000 query 800000 query 900000 query 5000000 query 2000000 query 1000000 query 50000000 query 2...
result:
ok correct
Test #11:
score: 0
Accepted
time: 1ms
memory: 3740kb
input:
84 89 83 90 82 89 83 81 89 83 90 91 62 86 87 61 71 68 67 80 77 76 80 77 85 89 83 90 91 89 92 93 85 89 92 93 76 80 77 76 89 83 81 80 86 78 89 83 90 82 89 74 90 73 80 77 76 80 86 87 79 89 92 93
output:
query 0 query 5 query 8 query 6 query 7 query 50 query 80 query 60 query 500 query 800 query 600 query 700 query 5000 query 2000 query 3000 query 4000 query 50000 query 20000 query 10000 query 500000 query 200000 query 100000 query 5000000 query 2000000 query 1000000 query 50000000 query 80000000 qu...
result:
ok correct
Test #12:
score: -100
Wrong Answer
time: 0ms
memory: 3484kb
input:
0
output:
query 0 0
result:
wrong answer invalid type: 0