QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#165629#6394. Turn on the LightZXG_DZXXAC ✓2ms3880kbC++171.0kb2023-09-05 20:07:422023-09-05 20:07:43

Judging History

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

  • [2023-09-05 20:07:43]
  • 评测
  • 测评结果:AC
  • 用时:2ms
  • 内存:3880kb
  • [2023-09-05 20:07:42]
  • 提交

answer

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

#define x first
#define y second
typedef pair<int, int> PII;
typedef long long ll;

vector<int> Q{0};

int ask(int x)
{
    cout << "? " << x << endl;
    int res;
    cin >> res;
    return res;
}

void anser(int x)
{
    cout << "! " << x << endl;
}

int work(int l, int r)
{
    if(r - l + 1 == 1) return l;
    else if(r - l + 1 == 2)
    {
        int res = ask(l);
        if(res == Q.back()) return l;
        else return r;
    }
    int mid = l + r >> 1;
    int res = ask(l);
    if(res == Q.back()) return l;
    Q.push_back(res);
    res = ask(mid);
    if(res == Q.back()) return mid;
    Q.push_back(res);
    if(res == Q[Q.size() - 3]) return work(l + 1, mid - 1);
    else return work(mid + 1, r);
}

void solve()
{
    int n;
    cin >> n;
    int ans = work(1, n);
    anser(ans);
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0), cout.tie(0);
    // int T; cin >> T; while(T--)
    solve();
    return 0;
}

详细

Test #1:

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

input:

3
1
2

output:

? 1
? 2
! 3

result:

ok Correct position at 3

Test #2:

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

input:

10
1
2
3
4
5

output:

? 1
? 5
? 6
? 8
? 9
! 10

result:

ok Correct position at 10

Test #3:

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

input:

9
1
2
3
4
5

output:

? 1
? 5
? 6
? 7
? 8
! 9

result:

ok Correct position at 9

Test #4:

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

input:

8
1
2
3
4
5

output:

? 1
? 4
? 5
? 6
? 7
! 8

result:

ok Correct position at 8

Test #5:

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

input:

7
1
2
3
3

output:

? 1
? 4
? 5
? 6
! 6

result:

ok Correct position at 6

Test #6:

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

input:

6
1
2
3
3

output:

? 1
? 3
? 4
? 5
! 5

result:

ok Correct position at 5

Test #7:

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

input:

5
1
2
3

output:

? 1
? 3
? 4
! 5

result:

ok Correct position at 5

Test #8:

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

input:

4
1
2
3

output:

? 1
? 2
? 3
! 4

result:

ok Correct position at 4

Test #9:

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

input:

3
1
1

output:

? 1
? 2
! 2

result:

ok Correct position at 2

Test #10:

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

input:

2
1

output:

? 1
! 2

result:

ok Correct position at 2

Test #11:

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

input:

1

output:

! 1

result:

ok Correct position at 1

Test #12:

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

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
38

output:

? 1
? 500000
? 500001
? 750000
? 750001
? 875000
? 875001
? 937500
? 937501
? 968750
? 968751
? 984375
? 984376
? 992188
? 992189
? 996094
? 996095
? 998047
? 998048
? 999024
? 999025
? 999512
? 999513
? 999756
? 999757
? 999878
? 999879
? 999939
? 999940
? 999970
? 999971
? 999985
? 999986
? 999993...

result:

ok Correct position at 1000000

Test #13:

score: 0
Accepted
time: 2ms
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
30
31
32
33
34
35
36
37
38

output:

? 1
? 500000
? 500001
? 750000
? 750001
? 875000
? 875001
? 937500
? 937501
? 968750
? 968751
? 984375
? 984376
? 992187
? 992188
? 996093
? 996094
? 998046
? 998047
? 999023
? 999024
? 999511
? 999512
? 999755
? 999756
? 999877
? 999878
? 999938
? 999939
? 999969
? 999970
? 999984
? 999985
? 999992...

result:

ok Correct position at 999999

Test #14:

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

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
38

output:

? 1
? 499999
? 500000
? 749999
? 750000
? 874999
? 875000
? 937499
? 937500
? 968749
? 968750
? 984374
? 984375
? 992186
? 992187
? 996092
? 996093
? 998045
? 998046
? 999022
? 999023
? 999510
? 999511
? 999754
? 999755
? 999876
? 999877
? 999937
? 999938
? 999968
? 999969
? 999983
? 999984
? 999991...

result:

ok Correct position at 999998

Test #15:

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

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
38

output:

? 1
? 499999
? 500000
? 749998
? 749999
? 874998
? 874999
? 937498
? 937499
? 968748
? 968749
? 984373
? 984374
? 992185
? 992186
? 996091
? 996092
? 998044
? 998045
? 999021
? 999022
? 999509
? 999510
? 999753
? 999754
? 999875
? 999876
? 999936
? 999937
? 999967
? 999968
? 999982
? 999983
? 999990...

result:

ok Correct position at 999997

Test #16:

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

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
38

output:

? 1
? 499998
? 499999
? 749997
? 749998
? 874997
? 874998
? 937497
? 937498
? 968747
? 968748
? 984372
? 984373
? 992184
? 992185
? 996090
? 996091
? 998043
? 998044
? 999020
? 999021
? 999508
? 999509
? 999752
? 999753
? 999874
? 999875
? 999935
? 999936
? 999966
? 999967
? 999981
? 999982
? 999989...

result:

ok Correct position at 999996

Test #17:

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

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
38

output:

? 1
? 499998
? 499999
? 749997
? 749998
? 874996
? 874997
? 937496
? 937497
? 968746
? 968747
? 984371
? 984372
? 992183
? 992184
? 996089
? 996090
? 998042
? 998043
? 999019
? 999020
? 999507
? 999508
? 999751
? 999752
? 999873
? 999874
? 999934
? 999935
? 999965
? 999966
? 999980
? 999981
? 999988...

result:

ok Correct position at 999995

Test #18:

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

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
38

output:

? 1
? 499997
? 499998
? 749996
? 749997
? 874995
? 874996
? 937495
? 937496
? 968745
? 968746
? 984370
? 984371
? 992182
? 992183
? 996088
? 996089
? 998041
? 998042
? 999018
? 999019
? 999506
? 999507
? 999750
? 999751
? 999872
? 999873
? 999933
? 999934
? 999964
? 999965
? 999979
? 999980
? 999987...

result:

ok Correct position at 999994

Test #19:

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

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
38

output:

? 1
? 499997
? 499998
? 749995
? 749996
? 874994
? 874995
? 937494
? 937495
? 968744
? 968745
? 984369
? 984370
? 992181
? 992182
? 996087
? 996088
? 998040
? 998041
? 999017
? 999018
? 999505
? 999506
? 999749
? 999750
? 999871
? 999872
? 999932
? 999933
? 999963
? 999964
? 999978
? 999979
? 999986...

result:

ok Correct position at 999993

Test #20:

score: 0
Accepted
time: 2ms
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
38

output:

? 1
? 499996
? 499997
? 749994
? 749995
? 874993
? 874994
? 937493
? 937494
? 968743
? 968744
? 984368
? 984369
? 992180
? 992181
? 996086
? 996087
? 998039
? 998040
? 999016
? 999017
? 999504
? 999505
? 999748
? 999749
? 999870
? 999871
? 999931
? 999932
? 999962
? 999963
? 999977
? 999978
? 999985...

result:

ok Correct position at 999992

Test #21:

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

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
38

output:

? 1
? 499996
? 499997
? 749994
? 749995
? 874993
? 874994
? 937492
? 937493
? 968742
? 968743
? 984367
? 984368
? 992179
? 992180
? 996085
? 996086
? 998038
? 998039
? 999015
? 999016
? 999503
? 999504
? 999747
? 999748
? 999869
? 999870
? 999930
? 999931
? 999961
? 999962
? 999976
? 999977
? 999984...

result:

ok Correct position at 999991

Test #22:

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

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
1

output:

? 1
? 500000
? 2
? 250000
? 3
? 125001
? 4
? 62502
? 5
? 31253
? 6
? 15629
? 7
? 7817
? 8
? 3912
? 9
? 1960
? 10
? 984
? 11
? 497
? 12
? 254
? 13
? 133
? 14
? 73
? 15
? 43
! 43

result:

ok Correct position at 43

Test #23:

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

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

output:

? 1
? 500000
? 2
? 250000
? 3
? 125001
? 4
? 62502
? 5
? 31253
? 6
? 15629
? 7
? 7817
? 8
? 3912
? 9
? 1960
? 10
? 984
? 11
? 497
? 12
? 254
? 13
? 133
? 14
? 73
? 15
? 43
? 44
? 58
? 45
? 51
! 51

result:

ok Correct position at 51

Test #24:

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

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

output:

? 1
? 499999
? 2
? 250000
? 3
? 125001
? 4
? 62502
? 5
? 31253
? 6
? 15629
? 7
? 7817
? 8
? 3912
? 9
? 1960
? 10
? 984
? 11
? 497
? 12
? 254
? 13
? 133
? 14
? 73
? 15
? 43
? 44
? 58
? 45
? 51
! 51

result:

ok Correct position at 51

Test #25:

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

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

output:

? 1
? 499999
? 2
? 250000
? 3
? 125001
? 4
? 62502
? 5
? 31253
? 6
? 15629
? 7
? 7817
? 8
? 3912
? 9
? 1960
? 10
? 984
? 11
? 497
? 12
? 254
? 13
? 133
? 14
? 73
? 15
? 43
? 44
? 58
? 45
? 51
! 51

result:

ok Correct position at 51

Test #26:

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

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

output:

? 1
? 500000
? 500001
? 750000
? 750001
? 875000
? 875001
? 937500
? 937501
? 968750
? 968751
? 984375
? 984376
? 992188
? 992189
? 996094
? 996095
? 998047
? 998048
? 999024
? 999025
? 999512
? 999513
? 999756
? 999757
? 999878
? 999758
? 999817
? 999759
? 999787
? 999760
? 999773
? 999774
? 999780...

result:

ok Correct position at 999781

Test #27:

score: 0
Accepted
time: 2ms
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
30
31
32
33
33

output:

? 1
? 500000
? 500001
? 750000
? 750001
? 875000
? 875001
? 937500
? 937501
? 968750
? 968751
? 984375
? 984376
? 992187
? 992188
? 996093
? 996094
? 998046
? 998047
? 999023
? 999024
? 999511
? 999512
? 999755
? 999756
? 999877
? 999878
? 999938
? 999939
? 999969
? 999970
? 999984
? 999971
? 999977...

result:

ok Correct position at 999980

Test #28:

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

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

output:

? 1
? 499999
? 500000
? 749999
? 750000
? 874999
? 875000
? 937499
? 937500
? 968749
? 968750
? 984374
? 984375
? 992186
? 992187
? 996092
? 996093
? 998045
? 998046
? 999022
? 999023
? 999510
? 999511
? 999754
? 999755
? 999876
? 999877
? 999937
? 999938
? 999968
? 999969
? 999983
? 999970
? 999976...

result:

ok Correct position at 999979

Test #29:

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

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

output:

? 1
? 499999
? 500000
? 749998
? 749999
? 874998
? 874999
? 937498
? 937499
? 968748
? 968749
? 984373
? 984374
? 992185
? 992186
? 996091
? 996092
? 998044
? 998045
? 999021
? 999022
? 999509
? 999510
? 999753
? 999754
? 999875
? 999876
? 999936
? 999937
? 999967
? 999968
? 999982
? 999969
? 999975...

result:

ok Correct position at 999978

Test #30:

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

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

output:

? 1
? 500000
? 2
? 250000
? 250001
? 375000
? 375001
? 437500
? 437501
? 468750
? 468751
? 484375
? 484376
? 492187
? 492188
? 496093
? 496094
? 498046
? 498047
? 499023
? 499024
? 499511
? 499512
? 499755
? 499756
? 499877
? 499878
? 499938
? 499939
? 499969
? 499940
? 499954
? 499941
? 499947
! 49...

result:

ok Correct position at 499947

Test #31:

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

input:

999999
1
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
4
5
6
7
8
9
10
11
11

output:

? 1
? 500000
? 500001
? 750000
? 500002
? 625000
? 500003
? 562501
? 500004
? 531252
? 500005
? 515628
? 500006
? 507816
? 500007
? 503911
? 500008
? 501959
? 500009
? 500983
? 500010
? 500496
? 500011
? 500253
? 500012
? 500132
? 500013
? 500072
? 500014
? 500042
? 500043
? 500057
? 500058
? 500064...

result:

ok Correct position at 500070

Test #32:

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

input:

999998
1
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
4
5
4
5
4
5
4
5
5

output:

? 1
? 499999
? 500000
? 749999
? 500001
? 624999
? 500002
? 562500
? 500003
? 531251
? 500004
? 515627
? 500005
? 507815
? 500006
? 503910
? 500007
? 501958
? 500008
? 500982
? 500009
? 500495
? 500010
? 500252
? 500011
? 500131
? 500012
? 500071
? 500072
? 500101
? 500073
? 500086
? 500074
? 500079...

result:

ok Correct position at 500076

Test #33:

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

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
24
25
26
27
26
27
28
29
30
31
32
32

output:

? 1
? 499999
? 2
? 250000
? 250001
? 374999
? 375000
? 437499
? 437500
? 468749
? 468750
? 484374
? 484375
? 492186
? 492187
? 496092
? 496093
? 498045
? 498046
? 499022
? 499023
? 499510
? 499511
? 499754
? 499755
? 499876
? 499877
? 499937
? 499938
? 499968
? 499939
? 499953
? 499954
? 499960
? 49...

result:

ok Correct position at 499965

Test #34:

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

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:

? 1
? 500000
? 500001
? 750000
? 750001
? 875000
? 875001
? 937500
? 937501
? 968750
? 968751
? 984375
? 984376
? 992188
? 992189
? 996094
? 996095
? 998047
? 998048
? 999024
? 999025
? 999512
? 999513
? 999756
? 999757
? 999878
? 999879
? 999939
? 999940
? 999970
? 999971
? 999985
? 999986
? 999993...

result:

ok Correct position at 999999

Test #35:

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

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:

? 1
? 500000
? 500001
? 750000
? 750001
? 875000
? 875001
? 937500
? 937501
? 968750
? 968751
? 984375
? 984376
? 992187
? 992188
? 996093
? 996094
? 998046
? 998047
? 999023
? 999024
? 999511
? 999512
? 999755
? 999756
? 999877
? 999878
? 999938
? 999939
? 999969
? 999970
? 999984
? 999985
? 999992...

result:

ok Correct position at 999998

Test #36:

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

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:

? 1
? 499999
? 500000
? 749999
? 750000
? 874999
? 875000
? 937499
? 937500
? 968749
? 968750
? 984374
? 984375
? 992186
? 992187
? 996092
? 996093
? 998045
? 998046
? 999022
? 999023
? 999510
? 999511
? 999754
? 999755
? 999876
? 999877
? 999937
? 999938
? 999968
? 999969
? 999983
? 999984
? 999991...

result:

ok Correct position at 999997

Test #37:

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

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:

? 1
? 499999
? 500000
? 749998
? 749999
? 874998
? 874999
? 937498
? 937499
? 968748
? 968749
? 984373
? 984374
? 992185
? 992186
? 996091
? 996092
? 998044
? 998045
? 999021
? 999022
? 999509
? 999510
? 999753
? 999754
? 999875
? 999876
? 999936
? 999937
? 999967
? 999968
? 999982
? 999983
? 999990...

result:

ok Correct position at 999996

Test #38:

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

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
38

output:

? 1
? 500000
? 500001
? 750000
? 750001
? 875000
? 875001
? 937500
? 937501
? 968750
? 968751
? 984375
? 984376
? 992188
? 992189
? 996094
? 996095
? 998047
? 998048
? 999024
? 999025
? 999512
? 999513
? 999756
? 999757
? 999878
? 999879
? 999939
? 999940
? 999970
? 999971
? 999985
? 999986
? 999993...

result:

ok Correct position at 1000000

Test #39:

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

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
38

output:

? 1
? 500000
? 500001
? 750000
? 750001
? 875000
? 875001
? 937500
? 937501
? 968750
? 968751
? 984375
? 984376
? 992187
? 992188
? 996093
? 996094
? 998046
? 998047
? 999023
? 999024
? 999511
? 999512
? 999755
? 999756
? 999877
? 999878
? 999938
? 999939
? 999969
? 999970
? 999984
? 999985
? 999992...

result:

ok Correct position at 999999

Test #40:

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

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
38

output:

? 1
? 499999
? 500000
? 749999
? 750000
? 874999
? 875000
? 937499
? 937500
? 968749
? 968750
? 984374
? 984375
? 992186
? 992187
? 996092
? 996093
? 998045
? 998046
? 999022
? 999023
? 999510
? 999511
? 999754
? 999755
? 999876
? 999877
? 999937
? 999938
? 999968
? 999969
? 999983
? 999984
? 999991...

result:

ok Correct position at 999998

Test #41:

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

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
38

output:

? 1
? 499999
? 500000
? 749998
? 749999
? 874998
? 874999
? 937498
? 937499
? 968748
? 968749
? 984373
? 984374
? 992185
? 992186
? 996091
? 996092
? 998044
? 998045
? 999021
? 999022
? 999509
? 999510
? 999753
? 999754
? 999875
? 999876
? 999936
? 999937
? 999967
? 999968
? 999982
? 999983
? 999990...

result:

ok Correct position at 999997

Test #42:

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

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
38

output:

? 1
? 500000
? 500001
? 750000
? 750001
? 875000
? 875001
? 937500
? 937501
? 968750
? 968751
? 984375
? 984376
? 992188
? 992189
? 996094
? 996095
? 998047
? 998048
? 999024
? 999025
? 999512
? 999513
? 999756
? 999757
? 999878
? 999879
? 999939
? 999940
? 999970
? 999971
? 999985
? 999986
? 999993...

result:

ok Correct position at 1000000

Test #43:

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

input:

1000000
0

output:

? 1
! 1

result:

ok Correct position at 1