QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#223988#5471. Interactive Number GuessingMihailo_JancevicWA 1ms3732kbC++14767b2023-10-22 22:47:382023-10-22 22:47:38

Judging History

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

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

answer

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

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

int main() {
    ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    cout<<"query 0"<<endl;
    cin>>s;
    if(s==0) {
        cout<<0<<'\n';
        exit(0);
    }
    for(long long i=1; i<1000000000000000000ll; i*=10) {
        l=1;
        r=10;
        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;
            if(r==m) s2=s1;
        }
        if(l==10) {
            l=0;
            cout<<"query "<<a+i*l<<endl;
            cin>>s2;
        }
        a+=i*l;
        s=s2;
    }
    cout<<"answer "<<1000000000000000000ll-a<<'\n';
}

详细

Test #1:

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

input:

6
11
5
4
12
9
3
2
10
7
1
9
6
9
1
6
9
1
6
9
1
6
9
1
6
9
1
6
9
1
6
9
1
6
9
1
6
9
1
6
9
1
6
9
1
6
9
1
6
9
1
6
9
1
6
9
1

output:

query 0
query 5
query 8
query 7
query 6
query 57
query 87
query 77
query 67
query 577
query 877
query 777
query 5877
query 8877
query 9877
query 59877
query 89877
query 99877
query 599877
query 899877
query 999877
query 5999877
query 8999877
query 9999877
query 59999877
query 89999877
query 99999877...

result:

ok correct

Test #2:

score: 0
Accepted
time: 1ms
memory: 3676kb

input:

89
85
92
93
81
79
78
86
83
77
76
75
80
74
82
70
77
78
75
60
59
76
64
67
68
59
55
62
63
60
54
62
50
48
56
44
51
52
40
38
46
34
32
31
39
27
25
24
23
28
22
30
27
3
2
1
6
9
10
1
6
9
10
1

output:

query 0
query 5
query 3
query 4
query 55
query 35
query 25
query 15
query 525
query 825
query 725
query 625
query 5625
query 8625
query 7625
query 58625
query 38625
query 48625
query 558625
query 858625
query 758625
query 658625
query 5758625
query 8758625
query 9758625
query 758625
query 50758625
q...

result:

ok correct

Test #3:

score: 0
Accepted
time: 1ms
memory: 3672kb

input:

88
93
87
95
83
81
80
79
84
78
77
76
72
70
78
66
64
63
62
58
65
57
44
60
43
48
51
52
43
48
42
41
49
46
40
48
45
39
47
35
42
43
31
38
39
27
34
35
23
30
31
19
17
16
15
2
18
1
6
9
10
1

output:

query 0
query 5
query 8
query 7
query 58
query 38
query 28
query 18
query 518
query 818
query 718
query 618
query 5618
query 3618
query 2618
query 53618
query 33618
query 23618
query 13618
query 513618
query 313618
query 413618
query 5413618
query 3413618
query 4413618
query 54413618
query 84413618
...

result:

ok correct

Test #4:

score: 0
Accepted
time: 1ms
memory: 3692kb

input:

95
91
98
99
87
94
95
83
81
89
77
75
74
82
79
73
72
80
68
66
65
64
51
49
66
54
57
58
49
54
48
47
46
42
40
39
47
44
47
39
35
33
41
29
27
35
23
21
20
28
25
19
18
17
13
11
10
9
14
8
7
6
2
9
1

output:

query 0
query 5
query 3
query 4
query 55
query 35
query 45
query 555
query 355
query 255
query 5355
query 3355
query 2355
query 1355
query 52355
query 82355
query 72355
query 62355
query 572355
query 372355
query 272355
query 172355
query 5172355
query 3172355
query 2172355
query 53172355
query 8317...

result:

ok correct

Test #5:

score: 0
Accepted
time: 0ms
memory: 3616kb

input:

75
80
74
73
72
77
71
70
78
66
64
63
71
59
66
58
54
61
53
58
52
51
50
55
49
48
47
52
46
45
53
41
39
38
37
42
45
37
42
36
35
34
39
33
32
40
28
26
25
33
21
28
20
25
28
20
16
23
15
11
9
17
5
3
2
1

output:

query 0
query 5
query 8
query 7
query 6
query 56
query 86
query 76
query 66
query 576
query 376
query 276
query 176
query 5276
query 3276
query 4276
query 54276
query 34276
query 44276
query 544276
query 844276
query 744276
query 644276
query 5644276
query 8644276
query 7644276
query 6644276
query 5...

result:

ok correct

Test #6:

score: 0
Accepted
time: 1ms
memory: 3668kb

input:

78
83
77
85
73
80
81
69
67
66
74
62
69
61
66
69
61
57
55
63
60
54
53
52
48
46
45
53
50
44
43
51
39
37
36
35
31
29
37
25
32
24
29
23
22
30
18
25
26
23
26
18
5
3
20
8
11
12
3
8
2
1
9

output:

query 0
query 5
query 8
query 7
query 58
query 38
query 48
query 558
query 358
query 258
query 158
query 5258
query 3258
query 4258
query 54258
query 84258
query 94258
query 594258
query 394258
query 294258
query 5394258
query 8394258
query 7394258
query 6394258
query 56394258
query 36394258
query 2...

result:

ok correct

Test #7:

score: 0
Accepted
time: 1ms
memory: 3688kb

input:

62
58
56
64
52
59
60
48
55
56
53
56
48
44
51
43
39
37
45
33
31
39
36
30
38
35
29
37
34
28
36
33
36
28
33
27
26
25
30
24
23
31
28
22
21
20
25
10
9
26
14
17
18
9
5
12
13
1
8
9

output:

query 0
query 5
query 3
query 2
query 53
query 33
query 43
query 553
query 353
query 453
query 5553
query 8553
query 9553
query 59553
query 39553
query 49553
query 549553
query 349553
query 249553
query 5349553
query 3349553
query 2349553
query 53349553
query 83349553
query 73349553
query 583349553
...

result:

ok correct

Test #8:

score: 0
Accepted
time: 1ms
memory: 3612kb

input:

46
51
54
55
46
51
45
53
50
53
45
32
48
49
37
40
41
32
37
31
39
36
30
29
28
33
36
28
33
18
35
23
26
27
18
23
17
25
22
16
15
23
11
9
17
14
8
7
15
12
15
7
12
6
5
4
9
3
2
1
6
9
1

output:

query 0
query 5
query 8
query 9
query 0
query 50
query 80
query 70
query 580
query 880
query 980
query 5980
query 3980
query 4980
query 55980
query 85980
query 95980
query 5980
query 505980
query 805980
query 705980
query 5805980
query 8805980
query 7805980
query 6805980
query 56805980
query 8680598...

result:

ok correct

Test #9:

score: 0
Accepted
time: 0ms
memory: 3604kb

input:

89
94
88
87
95
92
86
85
84
80
78
77
85
82
76
75
83
71
69
77
65
63
71
68
62
61
60
56
54
53
52
57
51
59
56
50
49
57
54
48
47
55
43
41
49
37
35
34
42
30
28
27
26
22
20
28
16
14
13
21
9
16
17
5
3
2
1

output:

query 0
query 5
query 8
query 7
query 6
query 57
query 87
query 77
query 67
query 567
query 367
query 267
query 167
query 5267
query 8267
query 7267
query 6267
query 57267
query 37267
query 27267
query 537267
query 337267
query 237267
query 5337267
query 8337267
query 7337267
query 6337267
query 563...

result:

ok correct

Test #10:

score: 0
Accepted
time: 1ms
memory: 3728kb

input:

63
68
71
72
63
68
62
61
69
66
60
59
67
64
58
57
65
53
60
61
58
34
60
39
42
43
34
39
42
43
34
30
28
27
26
31
34
26
22
20
28
25
19
18
17
22
16
24
21
15
14
13
9
7
6
14
11
5
13
10
4
12
9
3
2
1

output:

query 0
query 5
query 8
query 9
query 0
query 50
query 80
query 70
query 60
query 570
query 870
query 770
query 670
query 5770
query 8770
query 7770
query 6770
query 57770
query 37770
query 47770
query 557770
query 857770
query 757770
query 5857770
query 8857770
query 9857770
query 857770
query 5085...

result:

ok correct

Test #11:

score: 0
Accepted
time: 1ms
memory: 3684kb

input:

84
89
83
82
90
78
85
86
83
77
76
84
54
52
78
57
60
61
52
57
60
61
52
48
46
45
44
49
43
42
50
47
50
42
47
50
33
38
41
42
33
29
36
37
25
23
22
30
27
21
20
19
24
9
8
7
12
15
16
7
3
1
9
6
9
1

output:

query 0
query 5
query 8
query 7
query 6
query 57
query 37
query 47
query 557
query 857
query 757
query 657
query 5757
query 3757
query 2757
query 53757
query 83757
query 93757
query 3757
query 503757
query 803757
query 903757
query 3757
query 5003757
query 3003757
query 2003757
query 1003757
query 5...

result:

ok correct

Test #12:

score: -100
Wrong Answer
time: 0ms
memory: 3732kb

input:

0

output:

query 0
0

result:

wrong answer invalid type: 0