QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#201752#6394. Turn on the Lightucup-team870#AC ✓1ms3952kbC++141.5kb2023-10-05 16:37:152023-10-05 16:37:16

Judging History

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

  • [2023-10-05 16:37:16]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3952kb
  • [2023-10-05 16:37:15]
  • 提交

answer

#include<bits/stdc++.h>
#define For(i,j,k) for(int i=j;i<=k;++i)
using namespace std;
void pr(int x){
    printf("! %d\n",x); fflush(stdout); exit(0);
}
int qu(int x){
    printf("? %d\n",x); fflush(stdout);
    int y; cin>>y; return y;
}
void dfs(int l,int r,int cnt,int ty){
    int tmp;
    if (cnt){
        while(cnt){
            int mid=(l+r)>>1; tmp=qu(mid);
            if (tmp==cnt+1){
                ++cnt;
                if (!ty) l=mid+1;
                else r=mid-1;
            }
            else if (tmp==cnt) pr(mid);
            else{
                --cnt;
                if (!ty) r=mid-1;
                else l=mid+1;
            }
        }
    }
    if (l==r) pr(l);
    if (!cnt){
        int mid=(l+r)>>1,ml=(l+mid)>>1,mr=(mid+r)>>1;
        if (ml==mr) ++mr;
        tmp=qu(ml); if (!tmp) pr(ml);
        tmp=qu(mr);
        if (!tmp) dfs(ml+1,mr-1,0,0);
        else if (tmp==1) pr(mr);
        // l, ml , mr , r
        --ml; ++mr; cnt=2;
        while(1){
            // l
            if (l<=ml){
                int dl=(l+ml)>>1; tmp=qu(dl);
                if (tmp==cnt-1) dfs(dl+1,ml,cnt-1,1);
                else if (tmp==cnt) pr(dl);
                else ++cnt,ml=dl-1;
            }
            //
            if (r>=mr){
                int dr=(r+mr+1)>>1; tmp=qu(dr);
                if (tmp==cnt-1) dfs(mr,dr-1,cnt-1,0);
                else if (tmp==cnt) pr(dr);
                else ++cnt,mr=dr+1; 
            }
        }
    }
}
int main(){
    int n; cin>>n;
    dfs(1,n,0,0);
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3948kb

input:

3
1
2
2

output:

? 1
? 2
? 3
! 3

result:

ok Correct position at 3

Test #2:

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

input:

10
1
2
3
2
2

output:

? 3
? 7
? 1
? 9
? 8
! 8

result:

ok Correct position at 8

Test #3:

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

input:

9
1
2
3
2
2

output:

? 3
? 7
? 1
? 9
? 8
! 8

result:

ok Correct position at 8

Test #4:

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

input:

8
1
0
1
1

output:

? 2
? 6
? 3
? 4
! 4

result:

ok Correct position at 4

Test #5:

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

input:

7
1
2
3
2
2

output:

? 2
? 5
? 1
? 7
? 6
! 6

result:

ok Correct position at 6

Test #6:

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

input:

6
1
2
3
2
2

output:

? 2
? 4
? 1
? 6
? 5
! 5

result:

ok Correct position at 5

Test #7:

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

input:

5
1
2
3
3

output:

? 2
? 4
? 1
? 5
! 5

result:

ok Correct position at 5

Test #8:

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

input:

4
1
1

output:

? 1
? 3
! 3

result:

ok Correct position at 3

Test #9:

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

input:

3
1
1

output:

? 1
? 2
! 2

result:

ok Correct position at 2

Test #10:

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

input:

2
1
1

output:

? 1
? 2
! 2

result:

ok Correct position at 2

Test #11:

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

input:

1

output:

! 1

result:

ok Correct position at 1

Test #12:

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

input:

1000000
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
33

output:

? 250000
? 750000
? 375000
? 624999
? 312500
? 687500
? 281250
? 718750
? 265625
? 734375
? 257812
? 742188
? 253906
? 746094
? 251953
? 748047
? 250976
? 749024
? 250488
? 749512
? 250244
? 749756
? 250122
? 749878
? 250061
? 749939
? 250030
? 749970
? 250015
? 749985
? 250007
? 749993
? 250003
? 7...

result:

ok Correct position at 749999

Test #13:

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

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
30
31
32
33
34
35
35

output:

? 250000
? 749999
? 125000
? 875000
? 62500
? 937500
? 31250
? 968750
? 15625
? 984375
? 7812
? 992188
? 3906
? 996094
? 1953
? 998047
? 976
? 999024
? 488
? 999512
? 244
? 999756
? 122
? 999878
? 61
? 999939
? 30
? 999970
? 15
? 999985
? 7
? 999993
? 3
? 999997
? 1
? 999999
! 999999

result:

ok Correct position at 999999

Test #14:

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

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
30
31
32
33
34
35
35

output:

? 250000
? 749998
? 125000
? 874999
? 62500
? 937499
? 31250
? 968749
? 15625
? 984374
? 7812
? 992187
? 3906
? 996093
? 1953
? 998046
? 976
? 999023
? 488
? 999511
? 244
? 999755
? 122
? 999877
? 61
? 999938
? 30
? 999969
? 15
? 999984
? 7
? 999992
? 3
? 999996
? 1
? 999998
! 999998

result:

ok Correct position at 999998

Test #15:

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

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
30
31
32
33
34
35
35

output:

? 250000
? 749998
? 125000
? 874998
? 62500
? 937498
? 31250
? 968748
? 15625
? 984373
? 7812
? 992186
? 3906
? 996092
? 1953
? 998045
? 976
? 999022
? 488
? 999510
? 244
? 999754
? 122
? 999876
? 61
? 999937
? 30
? 999968
? 15
? 999983
? 7
? 999991
? 3
? 999995
? 1
? 999997
! 999997

result:

ok Correct position at 999997

Test #16:

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

input:

999996
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
33

output:

? 249999
? 749997
? 374999
? 624997
? 312499
? 687497
? 281249
? 718747
? 265624
? 734372
? 257811
? 742185
? 253905
? 746091
? 251952
? 748044
? 250975
? 749021
? 250487
? 749509
? 250243
? 749753
? 250121
? 749875
? 250060
? 749936
? 250029
? 749967
? 250014
? 749982
? 250006
? 749990
? 250002
? 7...

result:

ok Correct position at 749996

Test #17:

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

input:

999995
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
35

output:

? 249999
? 749996
? 124999
? 874996
? 62499
? 937496
? 31249
? 968746
? 15624
? 984371
? 7812
? 992184
? 3906
? 996090
? 1953
? 998043
? 976
? 999020
? 488
? 999508
? 244
? 999752
? 122
? 999874
? 61
? 999935
? 30
? 999966
? 15
? 999981
? 7
? 999989
? 3
? 999993
? 1
? 999995
! 999995

result:

ok Correct position at 999995

Test #18:

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

input:

999994
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
35

output:

? 249999
? 749995
? 124999
? 874995
? 62499
? 937495
? 31249
? 968745
? 15624
? 984370
? 7812
? 992183
? 3906
? 996089
? 1953
? 998042
? 976
? 999019
? 488
? 999507
? 244
? 999751
? 122
? 999873
? 61
? 999934
? 30
? 999965
? 15
? 999980
? 7
? 999988
? 3
? 999992
? 1
? 999994
! 999994

result:

ok Correct position at 999994

Test #19:

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

input:

999993
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
35

output:

? 249999
? 749995
? 124999
? 874995
? 62499
? 937495
? 31249
? 968745
? 15624
? 984370
? 7812
? 992182
? 3906
? 996088
? 1953
? 998041
? 976
? 999018
? 488
? 999506
? 244
? 999750
? 122
? 999872
? 61
? 999933
? 30
? 999964
? 15
? 999979
? 7
? 999987
? 3
? 999991
? 1
? 999993
! 999993

result:

ok Correct position at 999993

Test #20:

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

input:

999992
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
33

output:

? 249998
? 749994
? 374997
? 624994
? 312497
? 687494
? 281247
? 718744
? 265622
? 734369
? 257810
? 742182
? 253904
? 746088
? 251951
? 748041
? 250974
? 749018
? 250486
? 749506
? 250242
? 749750
? 250120
? 749872
? 250059
? 749933
? 250028
? 749964
? 250013
? 749979
? 250005
? 749987
? 250001
? 7...

result:

ok Correct position at 749993

Test #21:

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

input:

999991
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
35

output:

? 249998
? 749993
? 124999
? 874993
? 62499
? 937493
? 31249
? 968743
? 15624
? 984368
? 7812
? 992180
? 3906
? 996086
? 1953
? 998039
? 976
? 999016
? 488
? 999504
? 244
? 999748
? 122
? 999870
? 61
? 999931
? 30
? 999962
? 15
? 999977
? 7
? 999985
? 3
? 999989
? 1
? 999991
! 999991

result:

ok Correct position at 999991

Test #22:

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

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
25
24
24

output:

? 250000
? 750000
? 125000
? 875001
? 62500
? 937501
? 31250
? 968751
? 15625
? 984376
? 7812
? 992189
? 3906
? 996095
? 1953
? 998048
? 976
? 999025
? 488
? 999513
? 244
? 999757
? 122
? 999879
? 61
? 999940
? 30
? 45
? 37
? 41
? 43
! 43

result:

ok Correct position at 43

Test #23:

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

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
24
25
24
24

output:

? 250000
? 749999
? 125000
? 875000
? 62500
? 937500
? 31250
? 968750
? 15625
? 984375
? 7812
? 992188
? 3906
? 996094
? 1953
? 998047
? 976
? 999024
? 488
? 999512
? 244
? 999756
? 122
? 999878
? 61
? 999939
? 30
? 45
? 53
? 49
? 51
! 51

result:

ok Correct position at 51

Test #24:

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

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
24
25
24
24

output:

? 250000
? 749998
? 125000
? 874999
? 62500
? 937499
? 31250
? 968749
? 15625
? 984374
? 7812
? 992187
? 3906
? 996093
? 1953
? 998046
? 976
? 999023
? 488
? 999511
? 244
? 999755
? 122
? 999877
? 61
? 999938
? 30
? 45
? 53
? 49
? 51
! 51

result:

ok Correct position at 51

Test #25:

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

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
24
25
24
24

output:

? 250000
? 749998
? 125000
? 874998
? 62500
? 937498
? 31250
? 968748
? 15625
? 984373
? 7812
? 992186
? 3906
? 996092
? 1953
? 998045
? 976
? 999022
? 488
? 999510
? 244
? 999754
? 122
? 999876
? 61
? 999937
? 30
? 45
? 53
? 49
? 51
! 51

result:

ok Correct position at 51

Test #26:

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

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
21
20
21
22
21
21

output:

? 250000
? 750000
? 125000
? 875001
? 62500
? 937501
? 31250
? 968751
? 15625
? 984376
? 7812
? 992189
? 3906
? 996095
? 1953
? 998048
? 976
? 999025
? 488
? 999513
? 244
? 999757
? 122
? 999879
? 999818
? 999787
? 999772
? 999779
? 999783
? 999781
! 999781

result:

ok Correct position at 999781

Test #27:

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

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
28
29
29

output:

? 250000
? 749999
? 125000
? 875000
? 62500
? 937500
? 31250
? 968750
? 15625
? 984375
? 7812
? 992188
? 3906
? 996094
? 1953
? 998047
? 976
? 999024
? 488
? 999512
? 244
? 999756
? 122
? 999878
? 61
? 999939
? 30
? 999970
? 15
? 999985
? 999977
? 999981
? 999979
? 999980
! 999980

result:

ok Correct position at 999980

Test #28:

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

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
28
29
29

output:

? 250000
? 749998
? 125000
? 874999
? 62500
? 937499
? 31250
? 968749
? 15625
? 984374
? 7812
? 992187
? 3906
? 996093
? 1953
? 998046
? 976
? 999023
? 488
? 999511
? 244
? 999755
? 122
? 999877
? 61
? 999938
? 30
? 999969
? 15
? 999984
? 999976
? 999980
? 999978
? 999979
! 999979

result:

ok Correct position at 999979

Test #29:

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

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
28
29
29

output:

? 250000
? 749998
? 125000
? 874998
? 62500
? 937498
? 31250
? 968748
? 15625
? 984373
? 7812
? 992186
? 3906
? 996092
? 1953
? 998045
? 976
? 999022
? 488
? 999510
? 244
? 999754
? 122
? 999876
? 61
? 999937
? 30
? 999968
? 15
? 999983
? 999975
? 999979
? 999977
? 999978
! 999978

result:

ok Correct position at 999978

Test #30:

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

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
3
4
3
4
3
3

output:

? 250000
? 750000
? 375000
? 624999
? 437500
? 562498
? 468750
? 531248
? 484375
? 515623
? 492187
? 507810
? 496093
? 503903
? 498046
? 501950
? 499022
? 500973
? 499510
? 500484
? 499754
? 500240
? 499876
? 500118
? 499937
? 500057
? 499967
? 500026
? 499952
? 500042
? 499944
? 499948
? 499946
? 4...

result:

ok Correct position at 499947

Test #31:

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

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
1
2
3
3

output:

? 250000
? 749999
? 375000
? 624998
? 437500
? 562498
? 468750
? 531248
? 484375
? 515623
? 492187
? 507810
? 496093
? 503903
? 498046
? 501950
? 499022
? 500973
? 499510
? 500484
? 499754
? 500240
? 499876
? 500118
? 499937
? 500057
? 499906
? 500088
? 500072
? 500064
? 500068
? 500070
! 500070

result:

ok Correct position at 500070

Test #32:

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

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
2
2

output:

? 250000
? 749998
? 375000
? 624998
? 437500
? 562498
? 468750
? 531248
? 484375
? 515623
? 492187
? 507810
? 496093
? 503903
? 498046
? 501950
? 499022
? 500973
? 499510
? 500484
? 499754
? 500240
? 499876
? 500118
? 499937
? 500057
? 499906
? 500088
? 500072
? 500080
? 500076
! 500076

result:

ok Correct position at 500076

Test #33:

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

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
2
1
0
1
2
3
2
2

output:

? 250000
? 749998
? 375000
? 624998
? 437500
? 562498
? 468750
? 531248
? 484375
? 515623
? 492187
? 507810
? 496093
? 503903
? 498046
? 501950
? 499022
? 500973
? 499510
? 500484
? 499754
? 500240
? 499876
? 500118
? 499937
? 500057
? 499967
? 500026
? 499952
? 499959
? 499961
? 499964
? 499960
? 4...

result:

ok Correct position at 499965

Test #34:

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

input:

1000000
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
32
32

output:

? 250000
? 750000
? 375000
? 624999
? 312500
? 687500
? 281250
? 718750
? 265625
? 734375
? 257812
? 742188
? 253906
? 746094
? 251953
? 748047
? 250976
? 749024
? 250488
? 749512
? 250244
? 749756
? 250122
? 749878
? 250061
? 749939
? 250030
? 749970
? 250015
? 749985
? 250007
? 749993
? 250003
? 7...

result:

ok Correct position at 749998

Test #35:

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

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
30
31
32
33
34
35
34
34

output:

? 250000
? 749999
? 125000
? 875000
? 62500
? 937500
? 31250
? 968750
? 15625
? 984375
? 7812
? 992188
? 3906
? 996094
? 1953
? 998047
? 976
? 999024
? 488
? 999512
? 244
? 999756
? 122
? 999878
? 61
? 999939
? 30
? 999970
? 15
? 999985
? 7
? 999993
? 3
? 999997
? 1
? 999999
? 999998
! 999998

result:

ok Correct position at 999998

Test #36:

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

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
30
31
32
33
34
35
34
34

output:

? 250000
? 749998
? 125000
? 874999
? 62500
? 937499
? 31250
? 968749
? 15625
? 984374
? 7812
? 992187
? 3906
? 996093
? 1953
? 998046
? 976
? 999023
? 488
? 999511
? 244
? 999755
? 122
? 999877
? 61
? 999938
? 30
? 999969
? 15
? 999984
? 7
? 999992
? 3
? 999996
? 1
? 999998
? 999997
! 999997

result:

ok Correct position at 999997

Test #37:

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

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
30
31
32
33
34
35
34
34

output:

? 250000
? 749998
? 125000
? 874998
? 62500
? 937498
? 31250
? 968748
? 15625
? 984373
? 7812
? 992186
? 3906
? 996092
? 1953
? 998045
? 976
? 999022
? 488
? 999510
? 244
? 999754
? 122
? 999876
? 61
? 999937
? 30
? 999968
? 15
? 999983
? 7
? 999991
? 3
? 999995
? 1
? 999997
? 999996
! 999996

result:

ok Correct position at 999996

Test #38:

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

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
35

output:

? 250000
? 750000
? 125000
? 875001
? 62500
? 937501
? 31250
? 968751
? 15625
? 984376
? 7812
? 992189
? 3906
? 996095
? 1953
? 998048
? 976
? 999025
? 488
? 999513
? 244
? 999757
? 122
? 999879
? 61
? 999940
? 30
? 999971
? 15
? 999986
? 7
? 999994
? 3
? 999998
? 1
? 1000000
! 1000000

result:

ok Correct position at 1000000

Test #39:

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

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
30
31
32
33
34
35
35

output:

? 250000
? 749999
? 125000
? 875000
? 62500
? 937500
? 31250
? 968750
? 15625
? 984375
? 7812
? 992188
? 3906
? 996094
? 1953
? 998047
? 976
? 999024
? 488
? 999512
? 244
? 999756
? 122
? 999878
? 61
? 999939
? 30
? 999970
? 15
? 999985
? 7
? 999993
? 3
? 999997
? 1
? 999999
! 999999

result:

ok Correct position at 999999

Test #40:

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

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
30
31
32
33
34
35
35

output:

? 250000
? 749998
? 125000
? 874999
? 62500
? 937499
? 31250
? 968749
? 15625
? 984374
? 7812
? 992187
? 3906
? 996093
? 1953
? 998046
? 976
? 999023
? 488
? 999511
? 244
? 999755
? 122
? 999877
? 61
? 999938
? 30
? 999969
? 15
? 999984
? 7
? 999992
? 3
? 999996
? 1
? 999998
! 999998

result:

ok Correct position at 999998

Test #41:

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

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
30
31
32
33
34
35
35

output:

? 250000
? 749998
? 125000
? 874998
? 62500
? 937498
? 31250
? 968748
? 15625
? 984373
? 7812
? 992186
? 3906
? 996092
? 1953
? 998045
? 976
? 999022
? 488
? 999510
? 244
? 999754
? 122
? 999876
? 61
? 999937
? 30
? 999968
? 15
? 999983
? 7
? 999991
? 3
? 999995
? 1
? 999997
! 999997

result:

ok Correct position at 999997

Test #42:

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

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
35

output:

? 250000
? 750000
? 125000
? 875001
? 62500
? 937501
? 31250
? 968751
? 15625
? 984376
? 7812
? 992189
? 3906
? 996095
? 1953
? 998048
? 976
? 999025
? 488
? 999513
? 244
? 999757
? 122
? 999879
? 61
? 999940
? 30
? 999971
? 15
? 999986
? 7
? 999994
? 3
? 999998
? 1
? 1000000
! 1000000

result:

ok Correct position at 1000000

Test #43:

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

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
? 125000
? 875001
? 62500
? 937501
? 31250
? 968751
? 15625
? 984376
? 7812
? 992189
? 3906
? 996095
? 1953
? 998048
? 976
? 999025
? 488
? 999513
? 244
? 999757
? 122
? 999879
? 61
? 999940
? 30
? 999971
? 15
? 999986
? 7
? 999994
? 3
? 999998
? 1
! 1

result:

ok Correct position at 1