QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#594971#6394. Turn on the LightCarameowAC ✓1ms3728kbC++201.4kb2024-09-28 11:42:102024-09-28 11:42:11

Judging History

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

  • [2024-09-28 11:42:11]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3728kb
  • [2024-09-28 11:42:10]
  • 提交

answer

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

void init() {
   cin >> n;
}

int ask(int x) {
   cout << "? " << x << "\n";
   cout << flush;
   int a; cin >> a;
   return a;
}

void fav(int ans) {
   cout << "! " << ans << "\n";
   exit(0);
}

void range(int f1, int l1, int f2, int l2, int diff, int out, bool type) {
   if(type) {
      int mid = f1 + l2 >> 1;
      int val = ask(mid);
      if(abs(out) == val) fav(mid);

      if(out > 0) {
         if(val > out) range(f1, 0, 0, mid - 1, 0, val, 1);
         else range(mid + 1, 0, 0, l2, 0, val, 1);
      }
      else if(out < 0) {
         if(val > - out) range(mid + 1, 0, 0, l2, 0, - val, 1);
         else range(f1, 0, 0, mid - 1, 0, - val, 1);
      }
      else range(f1, mid - 1, mid + 1, l2, val, out, 0);
   }
   else {
      if(l1 - f1 + 1 >= l2 - f2 + 1) {
         int mid = l1 + f1 >> 1;
         int val = ask(mid);
         if(diff == val) fav(mid);

         if(diff > val) range(mid + 1, 0, 0, l1, 0, out + val, 1);
         else if(diff < val) range(f1, mid - 1, f2, l2, val, out, 0);
      }
      else {
         int mid = l2 + f2 >> 1;
         int val = ask(mid);
         if(diff == val) fav(mid);

         if(diff > val) range(f2, 0, 0, mid - 1, 0, out - val, 1);
         else if(diff < val) range(f1, l1, mid + 1, l2, val, out, 0);
      }
   }
}

int main () {
   init();

   range(1, 0, 0, n, 0, 0, 1);
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

3
1
2
2

output:

? 2
? 1
? 3
! 3

result:

ok Correct position at 3

Test #2:

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

input:

10
1
2
3
4
5
5

output:

? 5
? 8
? 2
? 9
? 1
? 10
! 10

result:

ok Correct position at 10

Test #3:

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

input:

9
1
2
3
4
5
5

output:

? 5
? 2
? 7
? 8
? 1
? 9
! 9

result:

ok Correct position at 9

Test #4:

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

input:

8
1
2
3
4
5
5

output:

? 4
? 6
? 2
? 7
? 1
? 8
! 8

result:

ok Correct position at 8

Test #5:

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

input:

7
1
2
3
3

output:

? 4
? 2
? 6
? 1
! 1

result:

ok Correct position at 1

Test #6:

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

input:

6
1
2
3
3

output:

? 3
? 5
? 1
? 6
! 6

result:

ok Correct position at 6

Test #7:

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

input:

5
1
2
3
3

output:

? 3
? 1
? 4
? 5
! 5

result:

ok Correct position at 5

Test #8:

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

input:

4
1
2
3
3

output:

? 2
? 3
? 1
? 4
! 4

result:

ok Correct position at 4

Test #9:

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

input:

3
1
1

output:

? 2
? 1
! 1

result:

ok Correct position at 1

Test #10:

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

input:

2
1
1

output:

? 1
? 2
! 2

result:

ok Correct position at 2

Test #11:

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

input:

1
0

output:

? 1
! 1

result:

ok Correct position at 1

Test #12:

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

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

output:

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

result:

ok Correct position at 1000000

Test #13:

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

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
36
37
37

output:

? 500000
? 250000
? 750000
? 125000
? 875000
? 62500
? 937500
? 31250
? 968750
? 15625
? 984375
? 7812
? 992187
? 996093
? 3906
? 998046
? 1953
? 999023
? 976
? 999511
? 488
? 999755
? 244
? 999877
? 122
? 999938
? 61
? 999969
? 30
? 999984
? 15
? 999992
? 7
? 999996
? 3
? 999998
? 1
? 999999
! 999999

result:

ok Correct position at 999999

Test #14:

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

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
36
37
37

output:

? 499999
? 749999
? 249999
? 874999
? 124999
? 937499
? 62499
? 968749
? 31249
? 984374
? 15624
? 992186
? 7812
? 996092
? 3906
? 998045
? 1953
? 999022
? 976
? 999510
? 488
? 999754
? 244
? 999876
? 122
? 999937
? 61
? 999968
? 30
? 999983
? 15
? 999991
? 7
? 999995
? 3
? 999997
? 1
? 999998
! 999998

result:

ok Correct position at 999998

Test #15:

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

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
36
37
37

output:

? 499999
? 249999
? 749998
? 874998
? 124999
? 937498
? 62499
? 968748
? 31249
? 984373
? 15624
? 992185
? 7812
? 996091
? 3906
? 998044
? 1953
? 999021
? 976
? 999509
? 488
? 999753
? 244
? 999875
? 122
? 999936
? 61
? 999967
? 30
? 999982
? 15
? 999990
? 7
? 999994
? 3
? 999996
? 1
? 999997
! 999997

result:

ok Correct position at 999997

Test #16:

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

input:

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

output:

? 499998
? 749997
? 249999
? 874997
? 124999
? 937497
? 62499
? 968747
? 31249
? 984372
? 15624
? 992184
? 7812
? 996090
? 3906
? 998043
? 1953
? 999020
? 976
? 999508
? 488
? 999752
? 244
? 999874
? 122
? 999935
? 61
? 999966
? 30
? 999981
? 15
? 999989
? 7
? 999993
? 3
? 999995
? 1
? 999996
! 999996

result:

ok Correct position at 999996

Test #17:

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

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
36
37
37

output:

? 499998
? 249999
? 749997
? 124999
? 874996
? 937496
? 62499
? 968746
? 31249
? 984371
? 15624
? 992183
? 7812
? 996089
? 3906
? 998042
? 1953
? 999019
? 976
? 999507
? 488
? 999751
? 244
? 999873
? 122
? 999934
? 61
? 999965
? 30
? 999980
? 15
? 999988
? 7
? 999992
? 3
? 999994
? 1
? 999995
! 999995

result:

ok Correct position at 999995

Test #18:

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

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
36
37
37

output:

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

result:

ok Correct position at 999994

Test #19:

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

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
36
37
37

output:

? 499997
? 249998
? 749995
? 874994
? 124999
? 937494
? 62499
? 968744
? 31249
? 984369
? 15624
? 992181
? 7812
? 996087
? 3906
? 998040
? 1953
? 999017
? 976
? 999505
? 488
? 999749
? 244
? 999871
? 122
? 999932
? 61
? 999963
? 30
? 999978
? 15
? 999986
? 7
? 999990
? 3
? 999992
? 1
? 999993
! 999993

result:

ok Correct position at 999993

Test #20:

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

input:

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

output:

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

result:

ok Correct position at 999992

Test #21:

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

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
36
37
37

output:

? 499996
? 249998
? 749994
? 124999
? 874993
? 62499
? 937492
? 968742
? 31249
? 984367
? 15624
? 992179
? 7812
? 996085
? 3906
? 998038
? 1953
? 999015
? 976
? 999503
? 488
? 999747
? 244
? 999869
? 122
? 999930
? 61
? 999961
? 30
? 999976
? 15
? 999984
? 7
? 999988
? 3
? 999990
? 1
? 999991
! 999991

result:

ok Correct position at 999991

Test #22:

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

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
27
28
27
26
26

output:

? 500000
? 750000
? 250000
? 875000
? 125000
? 937500
? 62500
? 968750
? 31250
? 984375
? 15625
? 992188
? 7812
? 996094
? 3906
? 998047
? 1953
? 999024
? 976
? 999512
? 488
? 999756
? 244
? 999878
? 122
? 999939
? 61
? 999970
? 30
? 45
? 37
? 41
? 43
! 43

result:

ok Correct position at 43

Test #23:

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

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
27
26
27
26
26

output:

? 500000
? 250000
? 750000
? 125000
? 875000
? 62500
? 937500
? 31250
? 968750
? 15625
? 984375
? 7812
? 992187
? 996093
? 3906
? 998046
? 1953
? 999023
? 976
? 999511
? 488
? 999755
? 244
? 999877
? 122
? 999938
? 61
? 999969
? 30
? 45
? 53
? 49
? 51
! 51

result:

ok Correct position at 51

Test #24:

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

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
27
26
27
26
26

output:

? 499999
? 749999
? 249999
? 874999
? 124999
? 937499
? 62499
? 968749
? 31249
? 984374
? 15624
? 992186
? 7812
? 996092
? 3906
? 998045
? 1953
? 999022
? 976
? 999510
? 488
? 999754
? 244
? 999876
? 122
? 999937
? 61
? 999968
? 30
? 45
? 53
? 49
? 51
! 51

result:

ok Correct position at 51

Test #25:

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

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
27
26
27
26
26

output:

? 499999
? 249999
? 749998
? 874998
? 124999
? 937498
? 62499
? 968748
? 31249
? 984373
? 15624
? 992185
? 7812
? 996091
? 3906
? 998044
? 1953
? 999021
? 976
? 999509
? 488
? 999753
? 244
? 999875
? 122
? 999936
? 61
? 999967
? 30
? 45
? 53
? 49
? 51
! 51

result:

ok Correct position at 51

Test #26:

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

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

output:

? 500000
? 750000
? 250000
? 875000
? 125000
? 937500
? 62500
? 968750
? 31250
? 984375
? 15625
? 992188
? 7812
? 996094
? 3906
? 998047
? 1953
? 999024
? 976
? 999512
? 488
? 999756
? 244
? 999878
? 999817
? 999786
? 999771
? 999778
? 999782
? 999780
? 999781
! 999781

result:

ok Correct position at 999781

Test #27:

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

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
29

output:

? 500000
? 250000
? 750000
? 125000
? 875000
? 62500
? 937500
? 31250
? 968750
? 15625
? 984375
? 7812
? 992187
? 996093
? 3906
? 998046
? 1953
? 999023
? 976
? 999511
? 488
? 999755
? 244
? 999877
? 122
? 999938
? 61
? 999969
? 30
? 999984
? 999976
? 999980
! 999980

result:

ok Correct position at 999980

Test #28:

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

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
29

output:

? 499999
? 749999
? 249999
? 874999
? 124999
? 937499
? 62499
? 968749
? 31249
? 984374
? 15624
? 992186
? 7812
? 996092
? 3906
? 998045
? 1953
? 999022
? 976
? 999510
? 488
? 999754
? 244
? 999876
? 122
? 999937
? 61
? 999968
? 30
? 999983
? 999975
? 999979
! 999979

result:

ok Correct position at 999979

Test #29:

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

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
29

output:

? 499999
? 249999
? 749998
? 874998
? 124999
? 937498
? 62499
? 968748
? 31249
? 984373
? 15624
? 992185
? 7812
? 996091
? 3906
? 998044
? 1953
? 999021
? 976
? 999509
? 488
? 999753
? 244
? 999875
? 122
? 999936
? 61
? 999967
? 30
? 999982
? 999974
? 999978
! 999978

result:

ok Correct position at 999978

Test #30:

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

input:

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

output:

? 500000
? 750000
? 250000
? 375000
? 437500
? 406250
? 468750
? 390625
? 484375
? 382812
? 492187
? 496093
? 378906
? 498046
? 376953
? 499023
? 375976
? 499511
? 375488
? 499755
? 375244
? 499877
? 375122
? 499938
? 375061
? 499969
? 499953
? 499945
? 499949
? 499947
! 499947

result:

ok Correct position at 499947

Test #31:

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

input:

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

output:

? 500000
? 250000
? 750000
? 625000
? 562500
? 531250
? 593750
? 515625
? 609375
? 507812
? 617187
? 621093
? 503906
? 623046
? 501953
? 624023
? 500976
? 624511
? 500488
? 624755
? 500244
? 624877
? 500122
? 624938
? 500061
? 500091
? 500076
? 500068
? 500072
? 500070
! 500070

result:

ok Correct position at 500070

Test #32:

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

input:

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

output:

? 499999
? 749999
? 624999
? 562499
? 687499
? 531249
? 718749
? 515624
? 734374
? 507811
? 742186
? 746092
? 503905
? 748045
? 501952
? 749022
? 500975
? 749510
? 500487
? 749754
? 500243
? 749876
? 500121
? 749937
? 500060
? 500090
? 500075
? 500082
? 500078
? 500076
! 500076

result:

ok Correct position at 500076

Test #33:

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

input:

999997
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
22
23
24
25
24
24

output:

? 499999
? 249999
? 374999
? 312499
? 437499
? 281249
? 468749
? 265624
? 484374
? 257811
? 492186
? 496092
? 253905
? 498045
? 251952
? 499022
? 250975
? 499510
? 250487
? 499754
? 250243
? 499876
? 250121
? 499937
? 250060
? 499968
? 499952
? 499960
? 499964
? 499966
? 499965
! 499965

result:

ok Correct position at 499965

Test #34:

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

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

output:

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

result:

ok Correct position at 2

Test #35:

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

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

output:

? 500000
? 250000
? 750000
? 125000
? 875000
? 62500
? 937500
? 31250
? 968750
? 15625
? 984375
? 7812
? 992187
? 996093
? 3906
? 998046
? 1953
? 999023
? 976
? 999511
? 488
? 999755
? 244
? 999877
? 122
? 999938
? 61
? 999969
? 30
? 999984
? 15
? 999992
? 7
? 999996
? 3
? 999998
? 1
? 2
! 2

result:

ok Correct position at 2

Test #36:

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

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

output:

? 499999
? 749999
? 249999
? 874999
? 124999
? 937499
? 62499
? 968749
? 31249
? 984374
? 15624
? 992186
? 7812
? 996092
? 3906
? 998045
? 1953
? 999022
? 976
? 999510
? 488
? 999754
? 244
? 999876
? 122
? 999937
? 61
? 999968
? 30
? 999983
? 15
? 999991
? 7
? 999995
? 3
? 999997
? 1
? 2
! 2

result:

ok Correct position at 2

Test #37:

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

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

output:

? 499999
? 249999
? 749998
? 874998
? 124999
? 937498
? 62499
? 968748
? 31249
? 984373
? 15624
? 992185
? 7812
? 996091
? 3906
? 998044
? 1953
? 999021
? 976
? 999509
? 488
? 999753
? 244
? 999875
? 122
? 999936
? 61
? 999967
? 30
? 999982
? 15
? 999990
? 7
? 999994
? 3
? 999996
? 1
? 2
! 2

result:

ok Correct position at 2

Test #38:

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

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

output:

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

result:

ok Correct position at 1000000

Test #39:

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

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
36
37
37

output:

? 500000
? 250000
? 750000
? 125000
? 875000
? 62500
? 937500
? 31250
? 968750
? 15625
? 984375
? 7812
? 992187
? 996093
? 3906
? 998046
? 1953
? 999023
? 976
? 999511
? 488
? 999755
? 244
? 999877
? 122
? 999938
? 61
? 999969
? 30
? 999984
? 15
? 999992
? 7
? 999996
? 3
? 999998
? 1
? 999999
! 999999

result:

ok Correct position at 999999

Test #40:

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

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
36
37
37

output:

? 499999
? 749999
? 249999
? 874999
? 124999
? 937499
? 62499
? 968749
? 31249
? 984374
? 15624
? 992186
? 7812
? 996092
? 3906
? 998045
? 1953
? 999022
? 976
? 999510
? 488
? 999754
? 244
? 999876
? 122
? 999937
? 61
? 999968
? 30
? 999983
? 15
? 999991
? 7
? 999995
? 3
? 999997
? 1
? 999998
! 999998

result:

ok Correct position at 999998

Test #41:

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

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
36
37
37

output:

? 499999
? 249999
? 749998
? 874998
? 124999
? 937498
? 62499
? 968748
? 31249
? 984373
? 15624
? 992185
? 7812
? 996091
? 3906
? 998044
? 1953
? 999021
? 976
? 999509
? 488
? 999753
? 244
? 999875
? 122
? 999936
? 61
? 999967
? 30
? 999982
? 15
? 999990
? 7
? 999994
? 3
? 999996
? 1
? 999997
! 999997

result:

ok Correct position at 999997

Test #42:

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

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

output:

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

result:

ok Correct position at 1000000

Test #43:

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

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:

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

result:

ok Correct position at 1