QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#223949#5471. Interactive Number GuessingMihailo_JancevicWA 1ms3732kbC++14590b2023-10-22 22:27:052023-10-22 22:27:05

Judging History

你现在查看的是最新测评结果

  • [2023-10-22 22:27:05]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3732kb
  • [2023-10-22 22:27:05]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

long long a, l, r, m, s, s1;

int main() {
    ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    cout<<"query 0"<<endl;
    cin>>s;
    for(long long i=1; i<1000000000000000000ll; i*=10) {
        l=1;
        r=9;
        while(l!=r) {
            m=(l+r)/2;
            cout<<"query "<<a+i*m<<endl;
            cin>>s1;
            if(s1==s+m) l=m+1;
            else r=m;
        }
        a+=i*l;
        cout<<"query "<<a<<endl;
        cin>>s;
    }
    cout<<"answer "<<1000000000000000000ll-a<<'\n';
}

詳細信息

Test #1:

score: 100
Accepted
time: 1ms
memory: 3732kb

input:

6
11
4
12
4
9
2
10
2
7
9
1
1
6
8
9
1
6
8
9
1
6
8
9
1
6
8
9
1
6
8
9
1
6
8
9
1
6
8
9
1
6
8
9
1
6
8
9
1
6
8
9
1
6
8
9
1
6
8
9
1
6
8
9
1
6
8
9
1
6
8
9
1

output:

query 0
query 5
query 7
query 6
query 7
query 57
query 77
query 67
query 77
query 577
query 777
query 877
query 877
query 5877
query 7877
query 8877
query 9877
query 59877
query 79877
query 89877
query 99877
query 599877
query 799877
query 899877
query 999877
query 5999877
query 7999877
query 899987...

result:

ok correct

Test #2:

score: -100
Wrong Answer
time: 1ms
memory: 3688kb

input:

89
85
92
93
85
81
79
78
86
78
83
76
75
75
80
82
74
74
70
77
78
70
75
59
76
59
64
66
67
68
64
71
72
64
69
71
63
63
59
57
65
57
53
60
61
53
49
47
55
47
43
41
40
48
40
36
34
33
32
32
37
39
31
31
36
11
10
10
15
17
18
19
24
26
27

output:

query 0
query 5
query 3
query 4
query 5
query 55
query 35
query 25
query 15
query 25
query 525
query 725
query 625
query 625
query 5625
query 7625
query 8625
query 8625
query 58625
query 38625
query 48625
query 58625
query 558625
query 758625
query 658625
query 758625
query 5758625
query 7758625
que...

result:

wrong answer query limit exceeded