QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#470384#6394. Turn on the LightUESTC_DECAYALI#AC ✓6ms10276kbC++17881b2024-07-10 12:31:402024-07-10 12:31:40

Judging History

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

  • [2024-07-10 12:31:40]
  • 评测
  • 测评结果:AC
  • 用时:6ms
  • 内存:10276kb
  • [2024-07-10 12:31:40]
  • 提交

answer

#include <bits/stdc++.h>

int query(int x) {
	static int pre = 0;
	std::cout << "? " << x + 1 << std::endl;
	int res; std::cin >> res;
	if(res == pre) return std::cout << "! " << x + 1 << std::endl, exit(0), 0;
	return pre =  res;
}

int main() {
	std::ios::sync_with_stdio(false);
	int n; std::cin >> n;
	int pre = 0;
	std::vector<int> a(n);
	for(int i = 0; i < n; ++i) a[i] = i;
	for(;;) {
		int l = a.size() / 4, r = a.size() * 3 / 4;
		int q = (query(a[l]), query(a[r]));
		std::vector<int> b = std::vector<int> {};
		if(q == pre) {
			for(int i = l + 1; i < r; ++i) b.push_back(a[i]);
		} else {
			for(int i = 0; i < l; ++i) b.push_back(a[i]);
			for(int i = r + 1; i < a.size(); ++i) b.push_back(a[i]);
		}
		a = b;
		// for(int i = 0; i < a.size(); ++i) std::cerr << a[i] << char(i == a.size() - 1 ? 10 : 32);
		pre = q;
	}
	return -1;
	
}

详细

Test #1:

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

input:

3
1
1

output:

? 1
? 3
! 3

result:

ok Correct position at 3

Test #2:

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

input:

10
1
0
1
0
0

output:

? 3
? 8
? 5
? 7
? 6
! 6

result:

ok Correct position at 6

Test #3:

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

input:

9
1
2
3
2
2

output:

? 3
? 7
? 2
? 9
? 8
! 8

result:

ok Correct position at 8

Test #4:

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

input:

8
1
0
1
0
0

output:

? 3
? 7
? 4
? 6
? 5
! 5

result:

ok Correct position at 5

Test #5:

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

input:

7
1
0
1
0
0

output:

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

result:

ok Correct position at 4

Test #6:

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

input:

6
1
0
1
1

output:

? 2
? 5
? 3
? 4
! 4

result:

ok Correct position at 4

Test #7:

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

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: 3524kb

input:

4
1
1

output:

? 2
? 4
! 4

result:

ok Correct position at 4

Test #9:

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

input:

3
1
0
0

output:

? 1
? 3
? 2
! 2

result:

ok Correct position at 2

Test #10:

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

input:

2
1
1

output:

? 1
? 2
! 2

result:

ok Correct position at 2

Test #11:

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

input:

1
0

output:

? 1
! 1

result:

ok Correct position at 1

Test #12:

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

input:

1000000
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
20
21
22
23
24
25
26
26

output:

? 250001
? 750001
? 375001
? 625001
? 437501
? 562501
? 468751
? 531251
? 484376
? 515626
? 492189
? 507813
? 488283
? 511720
? 486329
? 513673
? 485353
? 514650
? 484864
? 515138
? 484620
? 515382
? 484498
? 515504
? 484437
? 515565
? 484407
? 515596
? 484391
? 515611
? 484384
? 515619
? 484380
? 5...

result:

ok Correct position at 484377

Test #13:

score: 0
Accepted
time: 6ms
memory: 9460kb

input:

999999
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
20
21
22
23
24
25
26
26

output:

? 250000
? 750000
? 375000
? 625000
? 437500
? 562500
? 468750
? 531250
? 484375
? 515625
? 492188
? 507812
? 488282
? 511719
? 486328
? 513672
? 485352
? 514649
? 484863
? 515137
? 484619
? 515381
? 484497
? 515503
? 484436
? 515564
? 484406
? 515595
? 484390
? 515610
? 484383
? 515618
? 484379
? 5...

result:

ok Correct position at 484376

Test #14:

score: 0
Accepted
time: 6ms
memory: 9688kb

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

output:

? 250000
? 749999
? 375000
? 624999
? 437500
? 562499
? 468750
? 531249
? 484375
? 515624
? 476563
? 523437
? 472656
? 527343
? 470703
? 529296
? 469727
? 530273
? 469238
? 530761
? 468994
? 531005
? 468872
? 531127
? 468811
? 531188
? 468781
? 531219
? 468765
? 531234
? 468758
? 531242
? 468754
? 5...

result:

ok Correct position at 468751

Test #15:

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

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
36

output:

? 250000
? 749998
? 125000
? 874998
? 62500
? 937498
? 31250
? 968748
? 15625
? 984373
? 7813
? 992186
? 3906
? 996092
? 1953
? 998045
? 977
? 999022
? 488
? 999510
? 244
? 999754
? 122
? 999876
? 61
? 999937
? 31
? 999968
? 15
? 999983
? 8
? 999991
? 4
? 999994
? 2
? 999996
? 1
! 1

result:

ok Correct position at 1

Test #16:

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

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

output:

? 250000
? 749998
? 375000
? 624998
? 312500
? 687498
? 281250
? 718748
? 265625
? 734373
? 257813
? 742186
? 253906
? 746092
? 251953
? 748045
? 250977
? 749022
? 250488
? 749510
? 250244
? 749754
? 250122
? 749876
? 250061
? 749937
? 250031
? 749968
? 250015
? 749983
? 250008
? 749991
? 250004
? 7...

result:

ok Correct position at 250001

Test #17:

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

input:

999995
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
? 749997
? 374999
? 624997
? 312499
? 687497
? 281249
? 718747
? 265624
? 734372
? 257812
? 742185
? 253905
? 746091
? 251952
? 748044
? 250976
? 749021
? 250487
? 749509
? 250243
? 749753
? 250121
? 749875
? 250060
? 749936
? 250030
? 749967
? 250014
? 749982
? 250007
? 749990
? 250003
? 7...

result:

ok Correct position at 250000

Test #18:

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

input:

999994
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
? 749996
? 374999
? 624997
? 437499
? 562497
? 406249
? 593747
? 390624
? 609372
? 382812
? 617185
? 378905
? 621091
? 376952
? 623044
? 375976
? 624021
? 375487
? 624509
? 375243
? 624753
? 375121
? 624875
? 375060
? 624936
? 375030
? 624967
? 375014
? 624982
? 375007
? 624990
? 375003
? 6...

result:

ok Correct position at 375000

Test #19:

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

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
36

output:

? 249999
? 749995
? 125000
? 874995
? 62500
? 937494
? 31250
? 968744
? 15625
? 984369
? 7813
? 992182
? 3906
? 996088
? 1953
? 998041
? 977
? 999018
? 488
? 999506
? 244
? 999750
? 122
? 999872
? 61
? 999933
? 31
? 999964
? 15
? 999979
? 8
? 999987
? 4
? 999990
? 2
? 999992
? 1
! 1

result:

ok Correct position at 1

Test #20:

score: 0
Accepted
time: 6ms
memory: 9732kb

input:

999992
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
? 749995
? 374998
? 624996
? 437498
? 562496
? 406248
? 593746
? 390623
? 609371
? 382811
? 617184
? 378904
? 621090
? 376951
? 623043
? 375975
? 624020
? 375486
? 624508
? 375242
? 624752
? 375120
? 624874
? 375059
? 624935
? 375029
? 624966
? 375013
? 624981
? 375006
? 624989
? 375002
? 6...

result:

ok Correct position at 374999

Test #21:

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

input:

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

? 249998
? 749994
? 374997
? 624995
? 437497
? 562495
? 406247
? 593745
? 390622
? 609370
? 382810
? 617183
? 378903
? 621089
? 376950
? 623042
? 375974
? 624019
? 375485
? 624507
? 375241
? 624751
? 375119
? 624873
? 375058
? 624934
? 375028
? 624965
? 375012
? 624980
? 375005
? 624988
? 375001
? 6...

result:

ok Correct position at 374998

Test #22:

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

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
28

output:

? 250001
? 750001
? 125000
? 875001
? 62500
? 937501
? 31250
? 968751
? 15625
? 984376
? 7813
? 992189
? 3906
? 996095
? 1953
? 998048
? 977
? 999025
? 488
? 999513
? 244
? 999757
? 122
? 999879
? 61
? 999940
? 31
? 999971
? 46
? 999956
? 39
? 999964
? 43
! 43

result:

ok Correct position at 43

Test #23:

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

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

output:

? 250000
? 750000
? 125000
? 875000
? 62500
? 937500
? 31250
? 968750
? 15625
? 984375
? 7813
? 992188
? 3906
? 996094
? 1953
? 998047
? 977
? 999024
? 488
? 999512
? 244
? 999756
? 122
? 999878
? 61
? 999939
? 31
? 999970
? 46
? 999955
? 54
? 999947
? 50
? 999951
? 52
? 999949
? 51
! 51

result:

ok Correct position at 51

Test #24:

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

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

output:

? 250000
? 749999
? 125000
? 874999
? 62500
? 937499
? 31250
? 968749
? 15625
? 984374
? 7813
? 992187
? 3906
? 996093
? 1953
? 998046
? 977
? 999023
? 488
? 999511
? 244
? 999755
? 122
? 999877
? 61
? 999938
? 31
? 999969
? 46
? 999954
? 54
? 999946
? 50
? 999950
? 52
? 999948
? 51
! 51

result:

ok Correct position at 51

Test #25:

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

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

output:

? 250000
? 749998
? 125000
? 874998
? 62500
? 937498
? 31250
? 968748
? 15625
? 984373
? 7813
? 992186
? 3906
? 996092
? 1953
? 998045
? 977
? 999022
? 488
? 999510
? 244
? 999754
? 122
? 999876
? 61
? 999937
? 31
? 999968
? 46
? 999953
? 54
? 999945
? 50
? 999949
? 52
? 999947
? 51
! 51

result:

ok Correct position at 51

Test #26:

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

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
25

output:

? 250001
? 750001
? 125000
? 875001
? 62500
? 937501
? 31250
? 968751
? 15625
? 984376
? 7813
? 992189
? 3906
? 996095
? 1953
? 998048
? 977
? 999025
? 488
? 999513
? 244
? 999757
? 122
? 999879
? 183
? 999818
? 214
? 999788
? 229
? 999773
? 222
? 999781
! 999781

result:

ok Correct position at 999781

Test #27:

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

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

output:

? 250000
? 750000
? 125000
? 875000
? 62500
? 937500
? 31250
? 968750
? 15625
? 984375
? 7813
? 992188
? 3906
? 996094
? 1953
? 998047
? 977
? 999024
? 488
? 999512
? 244
? 999756
? 122
? 999878
? 61
? 999939
? 31
? 999970
? 15
? 999985
? 23
? 999977
? 19
? 999981
? 21
? 999979
? 20
? 999980
! 999980

result:

ok Correct position at 999980

Test #28:

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

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

output:

? 250000
? 749999
? 125000
? 874999
? 62500
? 937499
? 31250
? 968749
? 15625
? 984374
? 7813
? 992187
? 3906
? 996093
? 1953
? 998046
? 977
? 999023
? 488
? 999511
? 244
? 999755
? 122
? 999877
? 61
? 999938
? 31
? 999969
? 15
? 999984
? 23
? 999976
? 19
? 999980
? 21
? 999978
? 20
? 999979
! 999979

result:

ok Correct position at 999979

Test #29:

score: 0
Accepted
time: 5ms
memory: 9440kb

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

output:

? 250000
? 749998
? 125000
? 874998
? 62500
? 937498
? 31250
? 968748
? 15625
? 984373
? 7813
? 992186
? 3906
? 996092
? 1953
? 998045
? 977
? 999022
? 488
? 999510
? 244
? 999754
? 122
? 999876
? 61
? 999937
? 31
? 999968
? 15
? 999983
? 23
? 999975
? 19
? 999979
? 21
? 999977
? 20
? 999978
! 999978

result:

ok Correct position at 999978

Test #30:

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

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
5
6
5
6
5
6
6

output:

? 250001
? 750001
? 375001
? 625001
? 437501
? 562501
? 468751
? 531251
? 484376
? 515626
? 492189
? 507813
? 496095
? 503907
? 498048
? 501954
? 499025
? 500977
? 499513
? 500489
? 499757
? 500245
? 499879
? 500123
? 499940
? 500062
? 499971
? 500031
? 499956
? 500047
? 499948
? 500054
? 499944
? 5...

result:

ok Correct position at 499947

Test #31:

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

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

output:

? 250000
? 750000
? 375000
? 625000
? 437500
? 562500
? 468750
? 531250
? 484375
? 515625
? 492188
? 507812
? 496094
? 503906
? 498047
? 501953
? 499024
? 500976
? 499512
? 500488
? 499756
? 500244
? 499878
? 500122
? 499939
? 500061
? 499909
? 500092
? 499924
? 500077
? 499932
? 500069
? 499928
? 5...

result:

ok Correct position at 500070

Test #32:

score: 0
Accepted
time: 5ms
memory: 9720kb

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
3
4
5
6
7
8
9
9

output:

? 250000
? 749999
? 375000
? 624999
? 437500
? 562499
? 468750
? 531249
? 484375
? 515624
? 492188
? 507812
? 496094
? 503906
? 498047
? 501953
? 499024
? 500976
? 499512
? 500488
? 499756
? 500244
? 499878
? 500122
? 499939
? 500061
? 499909
? 500092
? 499924
? 500077
? 499932
? 500069
? 499928
? 5...

result:

ok Correct position at 500076

Test #33:

score: 0
Accepted
time: 5ms
memory: 9732kb

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

output:

? 250000
? 749998
? 375000
? 624998
? 437500
? 562498
? 468750
? 531248
? 484375
? 515623
? 492187
? 507811
? 496093
? 503905
? 498046
? 501952
? 499023
? 500975
? 499511
? 500487
? 499755
? 500243
? 499877
? 500121
? 499938
? 500060
? 499969
? 500029
? 499954
? 500045
? 499962
? 500037
? 499966
? 5...

result:

ok Correct position at 499965

Test #34:

score: 0
Accepted
time: 6ms
memory: 10276kb

input:

1000000
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
20
21
22
23
24
25
26
26

output:

? 250001
? 750001
? 375001
? 625001
? 437501
? 562501
? 468751
? 531251
? 484376
? 515626
? 492189
? 507813
? 488283
? 511720
? 486329
? 513673
? 485353
? 514650
? 484864
? 515138
? 484620
? 515382
? 484498
? 515504
? 484437
? 515565
? 484407
? 515596
? 484391
? 515611
? 484384
? 515619
? 484380
? 5...

result:

ok Correct position at 484377

Test #35:

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

input:

999999
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
20
21
22
23
24
25
26
26

output:

? 250000
? 750000
? 375000
? 625000
? 437500
? 562500
? 468750
? 531250
? 484375
? 515625
? 492188
? 507812
? 488282
? 511719
? 486328
? 513672
? 485352
? 514649
? 484863
? 515137
? 484619
? 515381
? 484497
? 515503
? 484436
? 515564
? 484406
? 515595
? 484390
? 515610
? 484383
? 515618
? 484379
? 5...

result:

ok Correct position at 484376

Test #36:

score: 0
Accepted
time: 6ms
memory: 9512kb

input:

999998
1
0
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
20
20

output:

? 250000
? 749999
? 375000
? 624999
? 437500
? 562499
? 468750
? 531249
? 484375
? 515624
? 492188
? 507812
? 496094
? 503906
? 498047
? 501953
? 499024
? 500976
? 498536
? 501465
? 498291
? 501709
? 498169
? 501831
? 498108
? 501892
? 498078
? 501923
? 498062
? 501938
? 498055
? 501946
? 498051
? 5...

result:

ok Correct position at 498048

Test #37:

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

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
36

output:

? 250000
? 749998
? 125000
? 874998
? 62500
? 937498
? 31250
? 968748
? 15625
? 984373
? 7813
? 992186
? 3906
? 996092
? 1953
? 998045
? 977
? 999022
? 488
? 999510
? 244
? 999754
? 122
? 999876
? 61
? 999937
? 31
? 999968
? 15
? 999983
? 8
? 999991
? 4
? 999994
? 2
? 999996
? 1
! 1

result:

ok Correct position at 1

Test #38:

score: 0
Accepted
time: 6ms
memory: 9392kb

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:

? 250001
? 750001
? 125000
? 875001
? 62500
? 937501
? 31250
? 968751
? 15625
? 984376
? 7813
? 992189
? 3906
? 996095
? 1953
? 998048
? 977
? 999025
? 488
? 999513
? 244
? 999757
? 122
? 999879
? 61
? 999940
? 31
? 999971
? 15
? 999986
? 8
? 999994
? 4
? 999997
? 2
? 999999
? 1
? 1000000
! 1000000

result:

ok Correct position at 1000000

Test #39:

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

input:

999999
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
20
21
22
23
24
25
26
27
27

output:

? 250000
? 750000
? 375000
? 625000
? 437500
? 562500
? 468750
? 531250
? 484375
? 515625
? 492188
? 507812
? 488282
? 511719
? 486328
? 513672
? 485352
? 514649
? 484863
? 515137
? 484619
? 515381
? 484497
? 515503
? 484436
? 515564
? 484406
? 515595
? 484390
? 515610
? 484383
? 515618
? 484379
? 5...

result:

ok Correct position at 515624

Test #40:

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

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:

? 250000
? 749999
? 125000
? 874999
? 62500
? 937499
? 31250
? 968749
? 15625
? 984374
? 7813
? 992187
? 3906
? 996093
? 1953
? 998046
? 977
? 999023
? 488
? 999511
? 244
? 999755
? 122
? 999877
? 61
? 999938
? 31
? 999969
? 15
? 999984
? 8
? 999992
? 4
? 999995
? 2
? 999997
? 1
? 999998
! 999998

result:

ok Correct position at 999998

Test #41:

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

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:

? 250000
? 749998
? 125000
? 874998
? 62500
? 937498
? 31250
? 968748
? 15625
? 984373
? 7813
? 992186
? 3906
? 996092
? 1953
? 998045
? 977
? 999022
? 488
? 999510
? 244
? 999754
? 122
? 999876
? 61
? 999937
? 31
? 999968
? 15
? 999983
? 8
? 999991
? 4
? 999994
? 2
? 999996
? 1
? 999997
! 999997

result:

ok Correct position at 999997

Test #42:

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

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:

? 250001
? 750001
? 125000
? 875001
? 62500
? 937501
? 31250
? 968751
? 15625
? 984376
? 7813
? 992189
? 3906
? 996095
? 1953
? 998048
? 977
? 999025
? 488
? 999513
? 244
? 999757
? 122
? 999879
? 61
? 999940
? 31
? 999971
? 15
? 999986
? 8
? 999994
? 4
? 999997
? 2
? 999999
? 1
? 1000000
! 1000000

result:

ok Correct position at 1000000

Test #43:

score: 0
Accepted
time: 5ms
memory: 9652kb

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:

? 250001
? 750001
? 125000
? 875001
? 62500
? 937501
? 31250
? 968751
? 15625
? 984376
? 7813
? 992189
? 3906
? 996095
? 1953
? 998048
? 977
? 999025
? 488
? 999513
? 244
? 999757
? 122
? 999879
? 61
? 999940
? 31
? 999971
? 15
? 999986
? 8
? 999994
? 4
? 999997
? 2
? 999999
? 1
! 1

result:

ok Correct position at 1