QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#723369 | #5471. Interactive Number Guessing | emuach# | AC ✓ | 1ms | 3708kb | C++23 | 1017b | 2024-11-07 21:58:03 | 2024-11-07 21:58:04 |
Judging History
answer
#pragma GCC optimize("Ofast,unroll-loops,inline")
#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define pb push_back
//#define endl '\n'
#define all(x) x.begin(),x.end()
#define pll pair<ll,ll>
#define open(name) if(fopen(name".inp", "r")){freopen(name".inp", "r", stdin); freopen(name".out", "w", stdout);}
using namespace std;
const int maxN=2e5+5;
const int mod=1e9+7;
const int base=311;
ll n;
ll ask(ll x){
ll r;
cout<<"query "<<x<<endl;
cin>>r;
return r;
}
void Enter(){
ll cur=ask(0);
ll res=0;
for(ll i=100000000000000000;i;i/=10){
ll l=0,r=10;
while(l<r){
ll mid=l+r>>1;
if(ask(mid*i)==mid+cur)l=mid+1;
else r=mid;
}
res+=i*(l-1);
}
cout<<"answer "<<(ll)(1000000000000000000-1-res)<<endl;
}
//amogus
signed main(){
//open("tbrackets");
cin.tie(nullptr);ios_base::sync_with_stdio(NULL);
//int t=1;cin>>t;while(t--)
Enter();
}
详细
Test #1:
score: 100
Accepted
time: 1ms
memory: 3560kb
input:
6 11 14 15 11 14 15 11 14 15 11 14 15 11 14 15 11 14 15 11 14 15 11 14 15 11 14 15 11 14 15 11 14 15 11 14 15 11 14 15 11 14 15 11 14 15 11 14 6 11 5 13 11 5 4 12
output:
query 0 query 500000000000000000 query 800000000000000000 query 900000000000000000 query 50000000000000000 query 80000000000000000 query 90000000000000000 query 5000000000000000 query 8000000000000000 query 9000000000000000 query 500000000000000 query 800000000000000 query 900000000000000 query 5000...
result:
ok correct
Test #2:
score: 0
Accepted
time: 1ms
memory: 3612kb
input:
89 85 82 81 89 76 73 72 89 94 70 69 95 94 97 89 85 82 90 85 91 84 83 85 91 84 92 94 88 87 86 85 91 84 92 94 97 89 94 88 87 86 85 82 81 89 94 79 96 94 88 87 86 94 97 89 94 88 87 95 85 91 84 83 85 91 93
output:
query 0 query 500000000000000000 query 200000000000000000 query 100000000000000000 query 0 query 50000000000000000 query 20000000000000000 query 10000000000000000 query 0 query 5000000000000000 query 8000000000000000 query 7000000000000000 query 6000000000000000 query 500000000000000 query 800000000...
result:
ok correct
Test #3:
score: 0
Accepted
time: 0ms
memory: 3644kb
input:
88 84 81 80 88 75 90 92 84 81 89 93 87 86 85 93 87 86 85 93 87 86 85 93 87 86 85 93 96 88 93 96 88 93 87 95 84 81 80 88 75 90 92 84 90 92 84 81 89 84 90 83 91 93 87 86 94 84 81 89 93 87 95
output:
query 0 query 500000000000000000 query 200000000000000000 query 100000000000000000 query 0 query 50000000000000000 query 20000000000000000 query 40000000000000000 query 5000000000000000 query 2000000000000000 query 1000000000000000 query 500000000000000 query 800000000000000 query 700000000000000 qu...
result:
ok correct
Test #4:
score: 0
Accepted
time: 1ms
memory: 3708kb
input:
95 91 97 99 100 94 93 101 91 88 96 100 94 93 101 91 97 90 89 91 97 90 98 91 97 90 98 100 103 104 91 97 90 89 100 94 93 101 91 88 87 95 82 97 81 98 91 88 96 100 94 102 91 97 90 89 91 97 90 98 100 94 93 92 91 97 99
output:
query 0 query 500000000000000000 query 200000000000000000 query 400000000000000000 query 50000000000000000 query 80000000000000000 query 70000000000000000 query 60000000000000000 query 5000000000000000 query 2000000000000000 query 1000000000000000 query 500000000000000 query 800000000000000 query 70...
result:
ok correct
Test #5:
score: 0
Accepted
time: 1ms
memory: 3624kb
input:
75 71 68 76 71 77 70 78 71 77 79 80 83 84 71 77 79 71 77 70 69 80 74 82 80 74 73 81 80 83 84 71 68 76 80 74 82 80 74 73 81 80 74 73 81 71 77 79 71 77 79 71 77 70 69 80 74 82 80 74 73 72
output:
query 0 query 500000000000000000 query 200000000000000000 query 100000000000000000 query 50000000000000000 query 20000000000000000 query 40000000000000000 query 30000000000000000 query 5000000000000000 query 2000000000000000 query 4000000000000000 query 500000000000000 query 800000000000000 query 90...
result:
ok correct
Test #6:
score: 0
Accepted
time: 1ms
memory: 3552kb
input:
78 83 77 85 74 71 70 78 65 80 64 81 83 86 87 83 77 76 75 83 77 85 74 80 82 74 80 73 81 74 71 79 83 77 85 74 80 73 72 83 77 76 84 74 80 73 81 83 86 87 74 80 82 74 80 73 72 83 77 76 75 83 77 85
output:
query 0 query 500000000000000000 query 800000000000000000 query 700000000000000000 query 50000000000000000 query 20000000000000000 query 10000000000000000 query 0 query 5000000000000000 query 2000000000000000 query 4000000000000000 query 3000000000000000 query 500000000000000 query 800000000000000 q...
result:
ok correct
Test #7:
score: 0
Accepted
time: 1ms
memory: 3680kb
input:
62 67 61 60 59 67 61 60 59 58 55 54 62 67 52 69 67 61 60 68 67 61 69 67 61 60 68 67 70 71 67 70 62 67 70 62 67 70 62 58 64 57 65 58 64 57 65 58 64 66 67 70 71 67 61 60 59 67 61 60 59 58 64 57 56
output:
query 0 query 500000000000000000 query 800000000000000000 query 700000000000000000 query 600000000000000000 query 50000000000000000 query 80000000000000000 query 70000000000000000 query 60000000000000000 query 5000000000000000 query 2000000000000000 query 1000000000000000 query 0 query 5000000000000...
result:
ok correct
Test #8:
score: 0
Accepted
time: 1ms
memory: 3556kb
input:
46 51 54 55 51 45 44 52 51 45 44 52 51 54 55 51 45 53 42 48 41 49 51 45 53 51 54 46 42 39 38 46 51 54 37 51 54 55 51 45 44 52 51 54 46 42 39 38 46 51 36 35 34 51 54 55 51 45 53 51 54 55
output:
query 0 query 500000000000000000 query 800000000000000000 query 900000000000000000 query 50000000000000000 query 80000000000000000 query 70000000000000000 query 60000000000000000 query 5000000000000000 query 8000000000000000 query 7000000000000000 query 6000000000000000 query 500000000000000 query 8...
result:
ok correct
Test #9:
score: 0
Accepted
time: 1ms
memory: 3620kb
input:
89 85 82 90 94 88 87 86 85 91 84 83 85 91 84 92 85 82 90 85 91 84 83 85 91 84 92 94 88 96 94 88 96 94 97 89 85 82 90 94 88 87 95 85 91 84 92 85 91 84 92 94 88 96 85 91 84 83 94 88 87 95 94 88 87 95
output:
query 0 query 500000000000000000 query 200000000000000000 query 100000000000000000 query 50000000000000000 query 80000000000000000 query 70000000000000000 query 60000000000000000 query 5000000000000000 query 2000000000000000 query 4000000000000000 query 3000000000000000 query 500000000000000 query 2...
result:
ok correct
Test #10:
score: 0
Accepted
time: 1ms
memory: 3612kb
input:
63 68 62 61 69 68 71 63 68 71 63 59 65 58 57 68 62 61 69 68 71 63 68 62 61 69 59 65 58 66 68 71 72 59 56 64 59 56 55 63 50 47 46 63 68 71 45 68 62 61 60 68 62 70 68 62 70 68 62 61 69 68 71 72
output:
query 0 query 500000000000000000 query 800000000000000000 query 700000000000000000 query 600000000000000000 query 50000000000000000 query 80000000000000000 query 90000000000000000 query 5000000000000000 query 8000000000000000 query 9000000000000000 query 500000000000000 query 200000000000000 query 4...
result:
ok correct
Test #11:
score: 0
Accepted
time: 1ms
memory: 3636kb
input:
84 89 92 93 80 86 79 87 80 77 76 84 89 74 73 90 89 83 82 90 80 86 79 78 89 83 82 81 80 77 76 84 89 92 93 89 92 93 89 83 91 80 77 85 80 77 76 84 71 68 67 84 62 86 61 87 89 83 91 89 83 82 81 89 83 82 90
output:
query 0 query 500000000000000000 query 800000000000000000 query 900000000000000000 query 50000000000000000 query 20000000000000000 query 40000000000000000 query 30000000000000000 query 5000000000000000 query 2000000000000000 query 1000000000000000 query 0 query 500000000000000 query 800000000000000 ...
result:
ok correct
Test #12:
score: 0
Accepted
time: 1ms
memory: 3576kb
input:
0 5 8 9 5 8 9 5 8 9 5 8 9 5 8 9 5 8 9 5 8 9 5 8 9 5 8 9 5 8 9 5 8 9 5 8 9 5 8 9 5 8 9 5 8 9 5 8 9 5 8 9 5 8 9
output:
query 0 query 500000000000000000 query 800000000000000000 query 900000000000000000 query 50000000000000000 query 80000000000000000 query 90000000000000000 query 5000000000000000 query 8000000000000000 query 9000000000000000 query 500000000000000 query 800000000000000 query 900000000000000 query 5000...
result:
ok correct
Test #13:
score: 0
Accepted
time: 1ms
memory: 3628kb
input:
18 23 26 18 23 26 18 23 26 18 23 26 18 23 26 18 23 26 18 23 26 18 23 26 18 23 26 18 23 26 18 23 26 18 23 26 18 23 26 18 23 26 18 23 26 18 23 26 18 23 26 18 23 26 18
output:
query 0 query 500000000000000000 query 800000000000000000 query 900000000000000000 query 50000000000000000 query 80000000000000000 query 90000000000000000 query 5000000000000000 query 8000000000000000 query 9000000000000000 query 500000000000000 query 800000000000000 query 900000000000000 query 5000...
result:
ok correct
Test #14:
score: 0
Accepted
time: 1ms
memory: 3704kb
input:
36 41 35 43 41 35 43 41 35 43 41 35 43 41 35 43 41 35 43 41 35 43 41 35 43 41 35 43 41 35 43 41 35 43 41 35 43 41 35 43 41 35 43 41 35 43 41 35 43 41 35 43 41 35 43
output:
query 0 query 500000000000000000 query 800000000000000000 query 700000000000000000 query 50000000000000000 query 80000000000000000 query 70000000000000000 query 5000000000000000 query 8000000000000000 query 7000000000000000 query 500000000000000 query 800000000000000 query 700000000000000 query 5000...
result:
ok correct
Test #15:
score: 0
Accepted
time: 1ms
memory: 3608kb
input:
54 59 53 52 60 59 53 52 60 59 53 52 60 59 53 52 60 59 53 52 60 59 53 52 60 59 53 52 60 59 53 52 60 59 53 52 60 59 53 52 60 59 53 52 60 59 53 52 60 59 53 52 60 59 53 52 60 59 53 52 60 59 53 52 60 59 53 52 60 59 53 52 60
output:
query 0 query 500000000000000000 query 800000000000000000 query 700000000000000000 query 600000000000000000 query 50000000000000000 query 80000000000000000 query 70000000000000000 query 60000000000000000 query 5000000000000000 query 8000000000000000 query 7000000000000000 query 6000000000000000 quer...
result:
ok correct
Test #16:
score: 0
Accepted
time: 0ms
memory: 3708kb
input:
72 77 71 70 69 77 71 70 69 77 71 70 69 77 71 70 69 77 71 70 69 77 71 70 69 77 71 70 69 77 71 70 69 77 71 70 69 77 71 70 69 77 71 70 69 77 71 70 69 77 71 70 69 77 71 70 69 77 71 70 69 77 71 70 69 77 71 70 69 77 71 70 69
output:
query 0 query 500000000000000000 query 800000000000000000 query 700000000000000000 query 600000000000000000 query 50000000000000000 query 80000000000000000 query 70000000000000000 query 60000000000000000 query 5000000000000000 query 8000000000000000 query 7000000000000000 query 6000000000000000 quer...
result:
ok correct
Test #17:
score: 0
Accepted
time: 1ms
memory: 3608kb
input:
90 86 92 94 86 92 94 86 92 94 86 92 94 86 92 94 86 92 94 86 92 94 86 92 94 86 92 94 86 92 94 86 92 94 86 92 94 86 92 94 86 92 94 86 92 94 86 92 94 86 92 94 86 92 94
output:
query 0 query 500000000000000000 query 200000000000000000 query 400000000000000000 query 50000000000000000 query 20000000000000000 query 40000000000000000 query 5000000000000000 query 2000000000000000 query 4000000000000000 query 500000000000000 query 200000000000000 query 400000000000000 query 5000...
result:
ok correct
Test #18:
score: 0
Accepted
time: 0ms
memory: 3636kb
input:
108 104 110 103 111 104 110 103 111 104 110 103 111 104 110 103 111 104 110 103 111 104 110 103 111 104 110 103 111 104 110 103 111 104 110 103 111 104 110 103 111 104 110 103 111 104 110 103 111 104 110 103 111 104 110 103 111 104 110 103 111 104 110 103 111 104 110 103 111 104 110 103 111
output:
query 0 query 500000000000000000 query 200000000000000000 query 400000000000000000 query 300000000000000000 query 50000000000000000 query 20000000000000000 query 40000000000000000 query 30000000000000000 query 5000000000000000 query 2000000000000000 query 4000000000000000 query 3000000000000000 quer...
result:
ok correct
Test #19:
score: 0
Accepted
time: 0ms
memory: 3624kb
input:
126 122 128 121 120 122 128 121 120 122 128 121 120 122 128 121 120 122 128 121 120 122 128 121 120 122 128 121 120 122 128 121 120 122 128 121 120 122 128 121 120 122 128 121 120 122 128 121 120 122 128 121 120 122 128 121 120 122 128 121 120 122 128 121 120 122 128 121 120 122 128 121 120
output:
query 0 query 500000000000000000 query 200000000000000000 query 400000000000000000 query 300000000000000000 query 50000000000000000 query 20000000000000000 query 40000000000000000 query 30000000000000000 query 5000000000000000 query 2000000000000000 query 4000000000000000 query 3000000000000000 quer...
result:
ok correct
Test #20:
score: 0
Accepted
time: 1ms
memory: 3632kb
input:
144 140 137 145 140 137 145 140 137 145 140 137 145 140 137 145 140 137 145 140 137 145 140 137 145 140 137 145 140 137 145 140 137 145 140 137 145 140 137 145 140 137 145 140 137 145 140 137 145 140 137 145 140 137 145
output:
query 0 query 500000000000000000 query 200000000000000000 query 100000000000000000 query 50000000000000000 query 20000000000000000 query 10000000000000000 query 5000000000000000 query 2000000000000000 query 1000000000000000 query 500000000000000 query 200000000000000 query 100000000000000 query 5000...
result:
ok correct
Test #21:
score: 0
Accepted
time: 1ms
memory: 3636kb
input:
162 158 155 154 162 149 146 145 162 140 137 136 162 131 128 127 162 122 119 118 162 113 110 109 162 104 101 100 162 95 92 91 162 86 83 82 162 77 74 73 162 68 65 64 162 59 56 55 162 50 47 46 162 41 38 37 162 32 29 28 162 23 20 19 162 14 11 10 162 5 2 1 162
output:
query 0 query 500000000000000000 query 200000000000000000 query 100000000000000000 query 0 query 50000000000000000 query 20000000000000000 query 10000000000000000 query 0 query 5000000000000000 query 2000000000000000 query 1000000000000000 query 0 query 500000000000000 query 200000000000000 query 10...
result:
ok correct
Test #22:
score: 0
Accepted
time: 1ms
memory: 3684kb
input:
10 15 18 19 15 18 19 15 18 19 15 18 19 15 18 19 15 18 19 15 18 19 15 18 19 15 18 19 15 18 19 15 18 19 15 18 19 15 18 19 15 18 19 15 18 19 15 18 19 6 12 14 6 12 14
output:
query 0 query 500000000000000000 query 800000000000000000 query 900000000000000000 query 50000000000000000 query 80000000000000000 query 90000000000000000 query 5000000000000000 query 8000000000000000 query 9000000000000000 query 500000000000000 query 800000000000000 query 900000000000000 query 5000...
result:
ok correct
Test #23:
score: 0
Accepted
time: 0ms
memory: 3560kb
input:
15 20 23 24 20 23 24 20 23 24 20 23 24 20 23 24 20 23 24 20 23 24 20 23 24 20 23 24 20 23 24 20 23 24 20 23 24 20 23 24 20 23 24 20 23 24 20 23 24 11 8 7 15 2 17 1 18
output:
query 0 query 500000000000000000 query 800000000000000000 query 900000000000000000 query 50000000000000000 query 80000000000000000 query 90000000000000000 query 5000000000000000 query 8000000000000000 query 9000000000000000 query 500000000000000 query 800000000000000 query 900000000000000 query 5000...
result:
ok correct
Test #24:
score: 0
Accepted
time: 0ms
memory: 3556kb
input:
4 9 12 13 9 12 13 9 12 13 9 12 13 9 12 13 9 12 13 9 12 13 9 12 13 9 12 13 9 12 13 9 12 13 9 12 13 9 12 13 9 12 13 9 12 13 9 12 13 9 3 11 9 3 11
output:
query 0 query 500000000000000000 query 800000000000000000 query 900000000000000000 query 50000000000000000 query 80000000000000000 query 90000000000000000 query 5000000000000000 query 8000000000000000 query 9000000000000000 query 500000000000000 query 800000000000000 query 900000000000000 query 5000...
result:
ok correct
Test #25:
score: 0
Accepted
time: 1ms
memory: 3580kb
input:
9 14 17 18 14 17 18 14 17 18 14 17 18 14 17 18 14 17 18 14 17 18 14 17 18 14 17 18 14 17 18 14 17 18 14 17 18 14 17 18 14 17 18 14 17 18 14 17 18 14 8 16 5 11 4 3
output:
query 0 query 500000000000000000 query 800000000000000000 query 900000000000000000 query 50000000000000000 query 80000000000000000 query 90000000000000000 query 5000000000000000 query 8000000000000000 query 9000000000000000 query 500000000000000 query 800000000000000 query 900000000000000 query 5000...
result:
ok correct
Test #26:
score: 0
Accepted
time: 1ms
memory: 3612kb
input:
10 15 18 19 15 18 19 15 18 19 15 18 19 15 18 19 15 18 19 15 18 19 15 18 19 15 18 19 15 18 19 15 18 19 15 18 19 15 18 19 15 18 19 15 18 19 15 18 19 6 3 11 15 9 17
output:
query 0 query 500000000000000000 query 800000000000000000 query 900000000000000000 query 50000000000000000 query 80000000000000000 query 90000000000000000 query 5000000000000000 query 8000000000000000 query 9000000000000000 query 500000000000000 query 800000000000000 query 900000000000000 query 5000...
result:
ok correct