QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#281124#6394. Turn on the LightpiscesAC ✓4ms13416kbC++141.4kb2023-12-09 21:29:252023-12-09 21:29:25

Judging History

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

  • [2023-12-09 21:29:25]
  • 评测
  • 测评结果:AC
  • 用时:4ms
  • 内存:13416kb
  • [2023-12-09 21:29:25]
  • 提交

answer

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

int ask(int x) {
    int ret;
    cout << "? " << x << endl;
    cin >> ret;
    return ret;
    }
int id[2][2000005];

int main() {
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++)
        id[0][i] = i;
    bool op = 0;
    int bef = 0;
    while (n >= 4) {
        int p1 = n / 4, p2 = n - n / 4;
        int x = ask(id[op][p1]);
        if (x == bef) {
            cout << "! " << id[op][p1];
            return 0;
            }
        int y = ask(id[op][p2]);
        if (y == x) {
            cout << "! " << id[op][p2];
            return 0;
            }
        int delta = y - bef;
        op ^= 1;
        if (delta == 0) {
            int cnt = 0;
            for (int i = p1 + 1; i < p2; i++) {
                id[op][++cnt] = id[op ^ 1][i];
                }
            n = cnt;
            }
        else {
            int cnt = 0;
            for (int i = 1; i < p1; i++) {
                id[op][++cnt] = id[op ^ 1][i];
                }
            for (int i = p2 + 1; i <= n; i++) {
                id[op][++cnt] = id[op ^ 1][i];
                }
            n = cnt;
            }
        bef = y;
        }
    for (int i = 1; i <= n; i++) {
        int x = ask(id[op][i]);
        if (x == bef) {
            cout << "! " << id[op][i];
            return 0;
            }
        bef = x;
        }
    return 0;
}

詳細信息

Test #1:

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

input:

3
1
2
2

output:

? 1
? 2
? 3
! 3

result:

ok Correct position at 3

Test #2:

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

input:

10
1
0
1
0
1
1

output:

? 2
? 8
? 3
? 6
? 4
? 5
! 5

result:

ok Correct position at 5

Test #3:

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

input:

9
1
0
1
0
0

output:

? 2
? 7
? 3
? 5
? 4
! 4

result:

ok Correct position at 4

Test #4:

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

input:

8
1
0
1
1

output:

? 2
? 6
? 3
? 4
! 4

result:

ok Correct position at 4

Test #5:

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

input:

7
1
0
1
0
0

output:

? 1
? 6
? 2
? 4
? 3
! 3

result:

ok Correct position at 3

Test #6:

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

input:

6
1
0
1
1

output:

? 1
? 5
? 2
? 3
! 3

result:

ok Correct position at 3

Test #7:

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

input:

5
1
0
1
1

output:

? 1
? 4
? 2
? 3
! 3

result:

ok Correct position at 3

Test #8:

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

input:

4
1
1

output:

? 1
? 3
! 3

result:

ok Correct position at 3

Test #9:

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

input:

3
1
1

output:

? 1
? 2
! 2

result:

ok Correct position at 2

Test #10:

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

input:

2
1
1

output:

? 1
? 2
! 2

result:

ok Correct position at 2

Test #11:

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

input:

1
0

output:

? 1
! 1

result:

ok Correct position at 1

Test #12:

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

input:

1000000
1
0
1
0
1
0
1
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
24
25
24
25
26
26

output:

? 250000
? 750000
? 374999
? 625000
? 437499
? 562499
? 468748
? 531249
? 484373
? 515623
? 476560
? 523436
? 472653
? 527343
? 470700
? 529296
? 469723
? 530273
? 469235
? 530761
? 468991
? 531005
? 468869
? 531127
? 468808
? 531188
? 468777
? 531219
? 468762
? 531234
? 468754
? 531242
? 468750
? 5...

result:

ok Correct position at 531243

Test #13:

score: 0
Accepted
time: 3ms
memory: 13336kb

input:

999999
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
18
19
18
19
20
20

output:

? 249999
? 750000
? 374999
? 624999
? 437498
? 562499
? 468748
? 531248
? 484372
? 515623
? 492184
? 507810
? 496090
? 503903
? 498043
? 501949
? 497066
? 502926
? 496577
? 503415
? 496333
? 503659
? 496211
? 503781
? 496150
? 503842
? 496119
? 503873
? 496104
? 503888
? 496096
? 503896
? 496092
? 5...

result:

ok Correct position at 503897

Test #14:

score: 0
Accepted
time: 4ms
memory: 12612kb

input:

999998
1
0
1
0
1
0
1
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
24
25
24
25
26
26

output:

? 249999
? 749999
? 374998
? 624999
? 437498
? 562498
? 468747
? 531248
? 484372
? 515622
? 476559
? 523435
? 472652
? 527342
? 470699
? 529295
? 469722
? 530272
? 469234
? 530760
? 468990
? 531004
? 468868
? 531126
? 468807
? 531187
? 468776
? 531218
? 468761
? 531233
? 468753
? 531241
? 468749
? 5...

result:

ok Correct position at 531242

Test #15:

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

input:

999997
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
18
19
18
19
20
20

output:

? 249999
? 749998
? 374998
? 624998
? 437497
? 562498
? 468747
? 531247
? 484371
? 515622
? 492183
? 507809
? 496089
? 503902
? 498042
? 501948
? 497065
? 502925
? 496576
? 503414
? 496332
? 503658
? 496210
? 503780
? 496149
? 503841
? 496118
? 503872
? 496103
? 503887
? 496095
? 503895
? 496091
? 5...

result:

ok Correct position at 503896

Test #16:

score: 0
Accepted
time: 4ms
memory: 11688kb

input:

999996
1
0
1
0
1
0
1
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
24
25
24
25
26
26

output:

? 249999
? 749997
? 374998
? 624997
? 437497
? 562497
? 468746
? 531247
? 484371
? 515621
? 476558
? 523434
? 472651
? 527341
? 470698
? 529294
? 469721
? 530271
? 469233
? 530759
? 468989
? 531003
? 468867
? 531125
? 468806
? 531186
? 468775
? 531217
? 468760
? 531232
? 468752
? 531240
? 468748
? 5...

result:

ok Correct position at 531241

Test #17:

score: 0
Accepted
time: 3ms
memory: 12068kb

input:

999995
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
18
19
18
19
20
20

output:

? 249998
? 749997
? 374997
? 624997
? 437496
? 562497
? 468746
? 531246
? 484370
? 515621
? 492182
? 507808
? 496088
? 503901
? 498041
? 501947
? 497064
? 502924
? 496575
? 503413
? 496331
? 503657
? 496209
? 503779
? 496148
? 503840
? 496117
? 503871
? 496102
? 503886
? 496094
? 503894
? 496090
? 5...

result:

ok Correct position at 503895

Test #18:

score: 0
Accepted
time: 2ms
memory: 13148kb

input:

999994
1
0
1
0
1
0
1
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
24
25
24
25
26
26

output:

? 249998
? 749996
? 374997
? 624996
? 437496
? 562496
? 468745
? 531246
? 484370
? 515620
? 476557
? 523433
? 472650
? 527340
? 470697
? 529293
? 469720
? 530270
? 469232
? 530758
? 468988
? 531002
? 468866
? 531124
? 468805
? 531185
? 468774
? 531216
? 468759
? 531231
? 468751
? 531239
? 468747
? 5...

result:

ok Correct position at 531240

Test #19:

score: 0
Accepted
time: 4ms
memory: 13072kb

input:

999993
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
18
19
18
19
20
20

output:

? 249998
? 749995
? 374997
? 624995
? 437496
? 562495
? 468745
? 531245
? 484369
? 515620
? 492181
? 507807
? 496087
? 503900
? 498040
? 501946
? 497063
? 502923
? 496574
? 503412
? 496330
? 503656
? 496208
? 503778
? 496147
? 503839
? 496116
? 503870
? 496101
? 503885
? 496093
? 503893
? 496089
? 5...

result:

ok Correct position at 503894

Test #20:

score: 0
Accepted
time: 4ms
memory: 12252kb

input:

999992
1
0
1
0
1
0
1
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
24
25
24
25
26
26

output:

? 249998
? 749994
? 374996
? 624995
? 437495
? 562495
? 468744
? 531245
? 484369
? 515619
? 476556
? 523432
? 472649
? 527339
? 470696
? 529292
? 469719
? 530269
? 469231
? 530757
? 468987
? 531001
? 468865
? 531123
? 468804
? 531184
? 468773
? 531215
? 468758
? 531230
? 468750
? 531238
? 468746
? 5...

result:

ok Correct position at 531239

Test #21:

score: 0
Accepted
time: 4ms
memory: 13416kb

input:

999991
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
18
19
18
19
20
20

output:

? 249997
? 749994
? 374996
? 624994
? 437495
? 562494
? 468744
? 531244
? 484368
? 515619
? 492180
? 507806
? 496086
? 503899
? 498039
? 501945
? 497062
? 502922
? 496573
? 503411
? 496329
? 503655
? 496207
? 503777
? 496146
? 503838
? 496115
? 503869
? 496100
? 503884
? 496092
? 503892
? 496088
? 5...

result:

ok Correct position at 503893

Test #22:

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

input:

1000000
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
25
26
27
28
27
28
27
28
27
28
27
27

output:

? 250000
? 750000
? 124999
? 875001
? 62499
? 937501
? 31249
? 968751
? 15624
? 984376
? 7811
? 992189
? 3905
? 996095
? 1952
? 998048
? 975
? 999025
? 487
? 999513
? 243
? 999757
? 121
? 999879
? 60
? 999940
? 29
? 999971
? 44
? 999955
? 36
? 999963
? 39
? 999959
? 40
? 999957
? 41
? 43
! 43

result:

ok Correct position at 43

Test #23:

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

input:

999999
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
25
26
25
26
26

output:

? 249999
? 750000
? 124999
? 875000
? 62499
? 937500
? 31249
? 968750
? 15624
? 984375
? 7811
? 992188
? 3905
? 996094
? 1952
? 998047
? 975
? 999024
? 487
? 999512
? 243
? 999756
? 121
? 999878
? 60
? 999939
? 29
? 999970
? 44
? 999954
? 51
! 51

result:

ok Correct position at 51

Test #24:

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

input:

999998
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
25
26
25
26
26

output:

? 249999
? 749999
? 124999
? 874999
? 62499
? 937499
? 31249
? 968749
? 15624
? 984374
? 7811
? 992187
? 3905
? 996093
? 1952
? 998046
? 975
? 999023
? 487
? 999511
? 243
? 999755
? 121
? 999877
? 60
? 999938
? 29
? 999969
? 44
? 999953
? 51
! 51

result:

ok Correct position at 51

Test #25:

score: 0
Accepted
time: 3ms
memory: 13304kb

input:

999997
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
25
26
25
26
26

output:

? 249999
? 749998
? 124999
? 874998
? 62499
? 937498
? 31249
? 968748
? 15624
? 984373
? 7811
? 992186
? 3905
? 996092
? 1952
? 998045
? 975
? 999022
? 487
? 999510
? 243
? 999754
? 121
? 999876
? 60
? 999937
? 29
? 999968
? 44
? 999952
? 51
! 51

result:

ok Correct position at 51

Test #26:

score: 0
Accepted
time: 3ms
memory: 11748kb

input:

1000000
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
22
23
22
23
22
23
24
25
26
27
26
27
27

output:

? 250000
? 750000
? 124999
? 875001
? 62499
? 937501
? 31249
? 968751
? 15624
? 984376
? 7811
? 992189
? 3905
? 996095
? 1952
? 998048
? 975
? 999025
? 487
? 999513
? 243
? 999757
? 121
? 999879
? 181
? 999818
? 211
? 999787
? 226
? 999771
? 218
? 999779
? 214
? 999783
? 215
? 999781
! 999781

result:

ok Correct position at 999781

Test #27:

score: 0
Accepted
time: 3ms
memory: 11776kb

input:

999999
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
28
29
30
31
30
31
32
32

output:

? 249999
? 750000
? 124999
? 875000
? 62499
? 937500
? 31249
? 968750
? 15624
? 984375
? 7811
? 992188
? 3905
? 996094
? 1952
? 998047
? 975
? 999024
? 487
? 999512
? 243
? 999756
? 121
? 999878
? 60
? 999939
? 29
? 999970
? 14
? 999985
? 21
? 999977
? 17
? 999981
? 18
? 999979
? 999980
! 999980

result:

ok Correct position at 999980

Test #28:

score: 0
Accepted
time: 3ms
memory: 12088kb

input:

999998
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
28
29
30
31
30
31
32
32

output:

? 249999
? 749999
? 124999
? 874999
? 62499
? 937499
? 31249
? 968749
? 15624
? 984374
? 7811
? 992187
? 3905
? 996093
? 1952
? 998046
? 975
? 999023
? 487
? 999511
? 243
? 999755
? 121
? 999877
? 60
? 999938
? 29
? 999969
? 14
? 999984
? 21
? 999976
? 17
? 999980
? 18
? 999978
? 999979
! 999979

result:

ok Correct position at 999979

Test #29:

score: 0
Accepted
time: 3ms
memory: 12080kb

input:

999997
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
28
29
30
31
30
31
32
32

output:

? 249999
? 749998
? 124999
? 874998
? 62499
? 937498
? 31249
? 968748
? 15624
? 984373
? 7811
? 992186
? 3905
? 996092
? 1952
? 998045
? 975
? 999022
? 487
? 999510
? 243
? 999754
? 121
? 999876
? 60
? 999937
? 29
? 999968
? 14
? 999983
? 21
? 999975
? 17
? 999979
? 18
? 999977
? 999978
! 999978

result:

ok Correct position at 999978

Test #30:

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

input:

1000000
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
2
2

output:

? 250000
? 750000
? 374999
? 625000
? 437499
? 562499
? 468748
? 531249
? 484373
? 515623
? 492185
? 507810
? 496091
? 503903
? 498043
? 501950
? 499019
? 500973
? 499507
? 500484
? 499751
? 500239
? 499872
? 500117
? 499933
? 500055
? 499963
? 500024
? 499947
! 499947

result:

ok Correct position at 499947

Test #31:

score: 0
Accepted
time: 3ms
memory: 12524kb

input:

999999
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
2
3
2
3
3

output:

? 249999
? 750000
? 374999
? 624999
? 437498
? 562499
? 468748
? 531248
? 484372
? 515623
? 492184
? 507810
? 496090
? 503903
? 498043
? 501949
? 499019
? 500972
? 499507
? 500483
? 499750
? 500239
? 499872
? 500116
? 499932
? 500055
? 499901
? 500086
? 499916
? 500070
! 500070

result:

ok Correct position at 500070

Test #32:

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

input:

999998
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
2
3
2
3
4
5
4
5
6
7
8
8

output:

? 249999
? 749999
? 374998
? 624999
? 437498
? 562498
? 468747
? 531248
? 484372
? 515622
? 492184
? 507809
? 496090
? 503902
? 498042
? 501949
? 499018
? 500972
? 499506
? 500483
? 499750
? 500238
? 499871
? 500116
? 499932
? 500054
? 499901
? 500085
? 499916
? 500069
? 499908
? 500077
? 499911
? 5...

result:

ok Correct position at 500076

Test #33:

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

input:

999997
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
2
3
4
3
4
4

output:

? 249999
? 749998
? 374998
? 624998
? 437497
? 562498
? 468747
? 531247
? 484371
? 515622
? 492183
? 507809
? 496089
? 503902
? 498042
? 501948
? 499018
? 500971
? 499506
? 500482
? 499749
? 500238
? 499871
? 500115
? 499931
? 500054
? 499961
? 500023
? 499976
? 500007
? 499968
? 500015
? 499964
? 5...

result:

ok Correct position at 499965

Test #34:

score: 0
Accepted
time: 3ms
memory: 12268kb

input:

1000000
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
0

output:

? 250000
? 750000
? 374999
? 625000
? 437499
? 562499
? 468748
? 531249
? 484373
? 515623
? 492185
? 507810
? 496091
? 503903
? 498043
? 501950
? 499019
? 500973
? 499507
? 500484
? 499751
? 500239
? 499872
? 500117
? 499933
? 500055
? 499963
? 500024
? 499978
? 500008
? 499985
? 500000
? 499988
? 4...

result:

ok Correct position at 499991

Test #35:

score: 0
Accepted
time: 3ms
memory: 12068kb

input:

999999
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
1

output:

? 249999
? 750000
? 374999
? 624999
? 437498
? 562499
? 468748
? 531248
? 484372
? 515623
? 492184
? 507810
? 496090
? 503903
? 498043
? 501949
? 499019
? 500972
? 499507
? 500483
? 499750
? 500239
? 499872
? 500116
? 499932
? 500055
? 499962
? 500024
? 499977
? 500008
? 499984
? 500000
? 499987
? 4...

result:

ok Correct position at 499991

Test #36:

score: 0
Accepted
time: 3ms
memory: 11680kb

input:

999998
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
0

output:

? 249999
? 749999
? 374998
? 624999
? 437498
? 562498
? 468747
? 531248
? 484372
? 515622
? 492184
? 507809
? 496090
? 503902
? 498042
? 501949
? 499018
? 500972
? 499506
? 500483
? 499750
? 500238
? 499871
? 500116
? 499932
? 500054
? 499962
? 500023
? 499977
? 500007
? 499984
? 499999
? 499987
? 4...

result:

ok Correct position at 499990

Test #37:

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

input:

999997
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
1

output:

? 249999
? 749998
? 374998
? 624998
? 437497
? 562498
? 468747
? 531247
? 484371
? 515622
? 492183
? 507809
? 496089
? 503902
? 498042
? 501948
? 499018
? 500971
? 499506
? 500482
? 499749
? 500238
? 499871
? 500115
? 499931
? 500054
? 499961
? 500023
? 499976
? 500007
? 499983
? 499999
? 499986
? 4...

result:

ok Correct position at 499990

Test #38:

score: 0
Accepted
time: 3ms
memory: 11632kb

input:

1000000
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
36

output:

? 250000
? 750000
? 124999
? 875001
? 62499
? 937501
? 31249
? 968751
? 15624
? 984376
? 7811
? 992189
? 3905
? 996095
? 1952
? 998048
? 975
? 999025
? 487
? 999513
? 243
? 999757
? 121
? 999879
? 60
? 999940
? 29
? 999971
? 14
? 999986
? 6
? 999994
? 2
? 999998
? 1
? 999999
? 1000000
! 1000000

result:

ok Correct position at 1000000

Test #39:

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

input:

999999
1
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
34

output:

? 249999
? 750000
? 374999
? 624999
? 312498
? 687500
? 281248
? 718750
? 265623
? 734375
? 257810
? 742188
? 253904
? 746094
? 251951
? 748047
? 250974
? 749024
? 250486
? 749512
? 250242
? 749756
? 250120
? 749878
? 250059
? 749939
? 250028
? 749970
? 250013
? 749985
? 250005
? 749993
? 250001
? 7...

result:

ok Correct position at 749999

Test #40:

score: 0
Accepted
time: 3ms
memory: 13220kb

input:

999998
1
0
1
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
32

output:

? 249999
? 749999
? 374998
? 624999
? 437498
? 562498
? 406247
? 593749
? 390622
? 609374
? 382809
? 617187
? 378903
? 621093
? 376950
? 623046
? 375973
? 624023
? 375485
? 624511
? 375241
? 624755
? 375119
? 624877
? 375058
? 624938
? 375027
? 624969
? 375012
? 624984
? 375004
? 624992
? 375000
? 6...

result:

ok Correct position at 624998

Test #41:

score: 0
Accepted
time: 4ms
memory: 13384kb

input:

999997
1
0
1
0
1
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
30

output:

? 249999
? 749998
? 374998
? 624998
? 437497
? 562498
? 468747
? 531247
? 453121
? 546873
? 445308
? 554686
? 441402
? 558592
? 439449
? 560545
? 438472
? 561522
? 437984
? 562010
? 437740
? 562254
? 437618
? 562376
? 437557
? 562437
? 437526
? 562468
? 437511
? 562483
? 437503
? 562491
? 437499
? 5...

result:

ok Correct position at 562497

Test #42:

score: 0
Accepted
time: 3ms
memory: 12340kb

input:

1000000
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
36

output:

? 250000
? 750000
? 124999
? 875001
? 62499
? 937501
? 31249
? 968751
? 15624
? 984376
? 7811
? 992189
? 3905
? 996095
? 1952
? 998048
? 975
? 999025
? 487
? 999513
? 243
? 999757
? 121
? 999879
? 60
? 999940
? 29
? 999971
? 14
? 999986
? 6
? 999994
? 2
? 999998
? 1
? 999999
? 1000000
! 1000000

result:

ok Correct position at 1000000

Test #43:

score: 0
Accepted
time: 2ms
memory: 12196kb

input:

1000000
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
34

output:

? 250000
? 750000
? 124999
? 875001
? 62499
? 937501
? 31249
? 968751
? 15624
? 984376
? 7811
? 992189
? 3905
? 996095
? 1952
? 998048
? 975
? 999025
? 487
? 999513
? 243
? 999757
? 121
? 999879
? 60
? 999940
? 29
? 999971
? 14
? 999986
? 6
? 999994
? 2
? 999998
? 1
! 1

result:

ok Correct position at 1