QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#820630#6394. Turn on the LightSuzuranovo#AC ✓552ms50692kbC++231.9kb2024-12-18 22:21:202024-12-18 22:21:21

Judging History

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

  • [2024-12-18 22:21:21]
  • 评测
  • 测评结果:AC
  • 用时:552ms
  • 内存:50692kb
  • [2024-12-18 22:21:20]
  • 提交

answer

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
int solve() {
    int n; cin >> n;
    auto query = [](int x) -> int {
        cout << "? " << x << endl;
        cin >> x;
        return x;
    };
    tree<int, null_type, less<>, rb_tree_tag, tree_order_statistics_node_update> tr;
    // auto insert = [&tr](int x) -> void {tr.insert(x); };
    for (int i = 1; i <= n; ++i) tr.insert(i);
    auto rank = [&tr](int x) -> int {return tr.order_of_key(x); };
    auto erase = [&](auto bg, auto ed) -> void {
        for (; bg != ed;)
            tr.erase(bg++);
    };
    auto get = [&tr]()->array<decltype(tr.begin()), 2> {
        int x = tr.size() / 4;
        auto lt = tr.find_by_order(x), rt = tr.find_by_order(tr.size() - 1 - x);
        return { lt,rt };
    };
    // auto before = [&](int x) -> int {
    //     int lft = rank(x);
    //     int rgt = tr.size() - 1 - lft;
    //     // cerr << "lft = " << lft << " rgt = " << rgt << endl;
    //     lft = x - 1 - lft;
    //     rgt = n - x - rgt;
    //     return abs(lft - rgt);
    // };
    int lst = 0;
    while (tr.size() >= 4) {
        auto [l, r] = get();
        // 删除前 获得输出的答案
        int ql = query(*l);
        if (ql == lst) return *l;
        int qr = query(*r);
        if (qr == ql) return *r;
        if (qr == lst) {
            // 若不变 删除两端
            erase(tr.begin(), next(l));
            erase(r, tr.end());
        } else {
            erase(l, next(r));
        }
        lst = qr;
    }
    for (auto it = tr.begin(); it != tr.end();) {
        int r = query(*it);
        if (r == lst) return *it;
        lst = r;
        tr.erase(it++);
    }
    return -1;
}
int main() {
    int res = solve();
    cout << "! " << res << endl;
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

3
1
2
2

output:

? 1
? 2
? 3
! 3

result:

ok Correct position at 3

Test #2:

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

input:

10
1
0
1
2
3
3

output:

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

result:

ok Correct position at 7

Test #3:

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

input:

9
1
2
3
4
5
5

output:

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

result:

ok Correct position at 9

Test #4:

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

input:

8
1
2
3
4
5
5

output:

? 3
? 6
? 2
? 7
? 1
? 8
! 8

result:

ok Correct position at 8

Test #5:

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

input:

7
1
0
1
1

output:

? 2
? 6
? 3
? 4
! 4

result:

ok Correct position at 4

Test #6:

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

input:

6
1
0
1
1

output:

? 2
? 5
? 3
? 4
! 4

result:

ok Correct position at 4

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

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

input:

3
1
1

output:

? 1
? 2
! 2

result:

ok Correct position at 2

Test #10:

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

input:

2
1
1

output:

? 1
? 2
! 2

result:

ok Correct position at 2

Test #11:

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

input:

1
0

output:

? 1
! 1

result:

ok Correct position at 1

Test #12:

score: 0
Accepted
time: 488ms
memory: 50472kb

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
? 750000
? 125001
? 875000
? 62501
? 937500
? 31251
? 968750
? 15626
? 984375
? 7813
? 992188
? 3907
? 996094
? 1954
? 998047
? 977
? 999024
? 489
? 999512
? 245
? 999756
? 123
? 999878
? 62
? 999939
? 31
? 999970
? 16
? 999985
? 8
? 999993
? 4
? 999997
? 2
? 999999
? 1
! 1

result:

ok Correct position at 1

Test #13:

score: 0
Accepted
time: 472ms
memory: 50460kb

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
? 511718
? 486329
? 513671
? 485352
? 514648
? 484864
? 515136
? 484620
? 515380
? 484498
? 515502
? 484437
? 515563
? 484406
? 515594
? 484391
? 515609
? 484383
? 515617
? 484379
? 5...

result:

ok Correct position at 484376

Test #14:

score: 0
Accepted
time: 500ms
memory: 50464kb

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
? 523436
? 472657
? 527342
? 470704
? 529295
? 469727
? 530272
? 469239
? 530760
? 468995
? 531004
? 468873
? 531126
? 468812
? 531187
? 468781
? 531218
? 468766
? 531233
? 468758
? 531241
? 468754
? 5...

result:

ok Correct position at 468751

Test #15:

score: 0
Accepted
time: 480ms
memory: 50476kb

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
? 992185
? 3907
? 996091
? 1954
? 998044
? 977
? 999021
? 489
? 999509
? 245
? 999753
? 123
? 999875
? 62
? 999936
? 31
? 999967
? 16
? 999982
? 8
? 999990
? 4
? 999994
? 2
? 999996
? 1
! 1

result:

ok Correct position at 1

Test #16:

score: 0
Accepted
time: 489ms
memory: 50472kb

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
36

output:

? 250000
? 749997
? 125000
? 874997
? 62500
? 937497
? 31250
? 968747
? 15625
? 984372
? 7813
? 992184
? 3907
? 996090
? 1954
? 998043
? 977
? 999020
? 489
? 999508
? 245
? 999752
? 123
? 999874
? 62
? 999935
? 31
? 999966
? 16
? 999981
? 8
? 999989
? 4
? 999993
? 2
? 999995
? 1
! 1

result:

ok Correct position at 1

Test #17:

score: 0
Accepted
time: 484ms
memory: 50412kb

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
? 742184
? 253906
? 746090
? 251953
? 748043
? 250976
? 749020
? 250488
? 749508
? 250244
? 749752
? 250122
? 749874
? 250061
? 749935
? 250030
? 749966
? 250015
? 749981
? 250007
? 749989
? 250003
? 7...

result:

ok Correct position at 250000

Test #18:

score: 0
Accepted
time: 483ms
memory: 50692kb

input:

999994
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
? 749996
? 374999
? 624996
? 312499
? 687496
? 281249
? 718746
? 265624
? 734371
? 257812
? 742183
? 253906
? 746089
? 251953
? 748042
? 250976
? 749019
? 250488
? 749507
? 250244
? 749751
? 250122
? 749873
? 250061
? 749934
? 250030
? 749965
? 250015
? 749980
? 250007
? 749988
? 250003
? 7...

result:

ok Correct position at 250000

Test #19:

score: 0
Accepted
time: 459ms
memory: 50692kb

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
? 874994
? 62500
? 937494
? 31250
? 968744
? 15625
? 984369
? 7813
? 992181
? 3907
? 996087
? 1954
? 998040
? 977
? 999017
? 489
? 999505
? 245
? 999749
? 123
? 999871
? 62
? 999932
? 31
? 999963
? 16
? 999978
? 8
? 999986
? 4
? 999990
? 2
? 999992
? 1
! 1

result:

ok Correct position at 1

Test #20:

score: 0
Accepted
time: 468ms
memory: 50616kb

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
36

output:

? 249999
? 749994
? 125000
? 874993
? 62500
? 937493
? 31250
? 968743
? 15625
? 984368
? 7813
? 992180
? 3907
? 996086
? 1954
? 998039
? 977
? 999016
? 489
? 999504
? 245
? 999748
? 123
? 999870
? 62
? 999931
? 31
? 999962
? 16
? 999977
? 8
? 999985
? 4
? 999989
? 2
? 999991
? 1
! 1

result:

ok Correct position at 1

Test #21:

score: 0
Accepted
time: 473ms
memory: 50652kb

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
? 617182
? 378904
? 621088
? 376951
? 623041
? 375974
? 624018
? 375486
? 624506
? 375242
? 624750
? 375120
? 624872
? 375059
? 624933
? 375028
? 624964
? 375013
? 624979
? 375005
? 624987
? 375001
? 6...

result:

ok Correct position at 374998

Test #22:

score: 0
Accepted
time: 483ms
memory: 50416kb

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
? 750000
? 125001
? 875000
? 62501
? 937500
? 31251
? 968750
? 15626
? 984375
? 7813
? 992188
? 3907
? 996094
? 1954
? 998047
? 977
? 999024
? 489
? 999512
? 245
? 999756
? 123
? 999878
? 62
? 999939
? 31
? 999970
? 47
? 999954
? 39
? 999962
? 43
! 43

result:

ok Correct position at 43

Test #23:

score: 0
Accepted
time: 552ms
memory: 50460kb

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
28

output:

? 250000
? 750000
? 125000
? 875000
? 62500
? 937500
? 31250
? 968750
? 15625
? 984375
? 7813
? 992187
? 3907
? 996093
? 1954
? 998046
? 977
? 999023
? 489
? 999511
? 245
? 999755
? 123
? 999877
? 62
? 999938
? 31
? 999969
? 47
? 999953
? 55
? 999945
? 51
! 51

result:

ok Correct position at 51

Test #24:

score: 0
Accepted
time: 480ms
memory: 50460kb

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
28

output:

? 250000
? 749999
? 125000
? 874999
? 62500
? 937499
? 31250
? 968749
? 15625
? 984374
? 7813
? 992186
? 3907
? 996092
? 1954
? 998045
? 977
? 999022
? 489
? 999510
? 245
? 999754
? 123
? 999876
? 62
? 999937
? 31
? 999968
? 47
? 999952
? 55
? 999944
? 51
! 51

result:

ok Correct position at 51

Test #25:

score: 0
Accepted
time: 489ms
memory: 50348kb

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
28

output:

? 250000
? 749998
? 125000
? 874998
? 62500
? 937498
? 31250
? 968748
? 15625
? 984373
? 7813
? 992185
? 3907
? 996091
? 1954
? 998044
? 977
? 999021
? 489
? 999509
? 245
? 999753
? 123
? 999875
? 62
? 999936
? 31
? 999967
? 47
? 999951
? 55
? 999943
? 51
! 51

result:

ok Correct position at 51

Test #26:

score: 0
Accepted
time: 473ms
memory: 50388kb

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

output:

? 250001
? 750000
? 125001
? 875000
? 62501
? 937500
? 31251
? 968750
? 15626
? 984375
? 7813
? 992188
? 3907
? 996094
? 1954
? 998047
? 977
? 999024
? 489
? 999512
? 245
? 999756
? 123
? 999878
? 184
? 999817
? 215
? 999786
? 230
? 999771
? 223
? 999778
? 219
? 999782
? 221
? 999780
? 220
? 999781
...

result:

ok Correct position at 999781

Test #27:

score: 0
Accepted
time: 488ms
memory: 50472kb

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
31

output:

? 250000
? 750000
? 125000
? 875000
? 62500
? 937500
? 31250
? 968750
? 15625
? 984375
? 7813
? 992187
? 3907
? 996093
? 1954
? 998046
? 977
? 999023
? 489
? 999511
? 245
? 999755
? 123
? 999877
? 62
? 999938
? 31
? 999969
? 16
? 999984
? 24
? 999976
? 20
? 999980
! 999980

result:

ok Correct position at 999980

Test #28:

score: 0
Accepted
time: 473ms
memory: 50612kb

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
31

output:

? 250000
? 749999
? 125000
? 874999
? 62500
? 937499
? 31250
? 968749
? 15625
? 984374
? 7813
? 992186
? 3907
? 996092
? 1954
? 998045
? 977
? 999022
? 489
? 999510
? 245
? 999754
? 123
? 999876
? 62
? 999937
? 31
? 999968
? 16
? 999983
? 24
? 999975
? 20
? 999979
! 999979

result:

ok Correct position at 999979

Test #29:

score: 0
Accepted
time: 473ms
memory: 50416kb

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
31

output:

? 250000
? 749998
? 125000
? 874998
? 62500
? 937498
? 31250
? 968748
? 15625
? 984373
? 7813
? 992185
? 3907
? 996091
? 1954
? 998044
? 977
? 999021
? 489
? 999509
? 245
? 999753
? 123
? 999875
? 62
? 999936
? 31
? 999967
? 16
? 999982
? 24
? 999974
? 20
? 999978
! 999978

result:

ok Correct position at 999978

Test #30:

score: 0
Accepted
time: 482ms
memory: 50648kb

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
? 750000
? 375001
? 625000
? 437501
? 562500
? 468751
? 531250
? 484376
? 515625
? 492189
? 507812
? 496095
? 503906
? 498048
? 501953
? 499025
? 500976
? 499513
? 500488
? 499757
? 500244
? 499879
? 500122
? 499940
? 500061
? 499971
? 500030
? 499956
? 500045
? 499948
? 500053
? 499944
? 5...

result:

ok Correct position at 499947

Test #31:

score: 0
Accepted
time: 478ms
memory: 50396kb

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
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
? 500091
? 499924
? 500076
? 499932
? 500068
? 499928
? 5...

result:

ok Correct position at 500070

Test #32:

score: 0
Accepted
time: 464ms
memory: 50400kb

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

output:

? 250000
? 749999
? 375000
? 624999
? 437500
? 562499
? 468750
? 531249
? 484375
? 515624
? 492188
? 507811
? 496094
? 503905
? 498047
? 501952
? 499024
? 500975
? 499512
? 500487
? 499756
? 500243
? 499878
? 500121
? 499939
? 500060
? 499909
? 500090
? 499924
? 500075
? 499917
? 500082
? 499921
? 5...

result:

ok Correct position at 500076

Test #33:

score: 0
Accepted
time: 473ms
memory: 50476kb

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
? 500044
? 499962
? 500036
? 499966
? 5...

result:

ok Correct position at 499965

Test #34:

score: 0
Accepted
time: 483ms
memory: 50472kb

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
? 750000
? 125001
? 875000
? 62501
? 937500
? 31251
? 968750
? 15626
? 984375
? 7813
? 992188
? 3907
? 996094
? 1954
? 998047
? 977
? 999024
? 489
? 999512
? 245
? 999756
? 123
? 999878
? 62
? 999939
? 31
? 999970
? 16
? 999985
? 8
? 999993
? 4
? 999997
? 2
? 999999
? 1
! 1

result:

ok Correct position at 1

Test #35:

score: 0
Accepted
time: 482ms
memory: 50460kb

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
? 511718
? 486329
? 513671
? 485352
? 514648
? 484864
? 515136
? 484620
? 515380
? 484498
? 515502
? 484437
? 515563
? 484406
? 515594
? 484391
? 515609
? 484383
? 515617
? 484379
? 5...

result:

ok Correct position at 484376

Test #36:

score: 0
Accepted
time: 484ms
memory: 50396kb

input:

999998
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
? 749999
? 375000
? 624999
? 437500
? 562499
? 468750
? 531249
? 484375
? 515624
? 492188
? 507811
? 488282
? 511717
? 486329
? 513670
? 485352
? 514647
? 484864
? 515135
? 484620
? 515379
? 484498
? 515501
? 484437
? 515562
? 484406
? 515593
? 484391
? 515608
? 484383
? 515616
? 484379
? 5...

result:

ok Correct position at 484376

Test #37:

score: 0
Accepted
time: 545ms
memory: 50476kb

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
? 992185
? 3907
? 996091
? 1954
? 998044
? 977
? 999021
? 489
? 999509
? 245
? 999753
? 123
? 999875
? 62
? 999936
? 31
? 999967
? 16
? 999982
? 8
? 999990
? 4
? 999994
? 2
? 999996
? 1
! 1

result:

ok Correct position at 1

Test #38:

score: 0
Accepted
time: 497ms
memory: 50396kb

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
? 750000
? 125001
? 875000
? 62501
? 937500
? 31251
? 968750
? 15626
? 984375
? 7813
? 992188
? 3907
? 996094
? 1954
? 998047
? 977
? 999024
? 489
? 999512
? 245
? 999756
? 123
? 999878
? 62
? 999939
? 31
? 999970
? 16
? 999985
? 8
? 999993
? 4
? 999997
? 2
? 999999
? 1
? 1000000
! 1000000

result:

ok Correct position at 1000000

Test #39:

score: 0
Accepted
time: 471ms
memory: 50456kb

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
? 511718
? 486329
? 513671
? 485352
? 514648
? 484864
? 515136
? 484620
? 515380
? 484498
? 515502
? 484437
? 515563
? 484406
? 515594
? 484391
? 515609
? 484383
? 515617
? 484379
? 5...

result:

ok Correct position at 515624

Test #40:

score: 0
Accepted
time: 482ms
memory: 50648kb

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
? 992186
? 3907
? 996092
? 1954
? 998045
? 977
? 999022
? 489
? 999510
? 245
? 999754
? 123
? 999876
? 62
? 999937
? 31
? 999968
? 16
? 999983
? 8
? 999991
? 4
? 999995
? 2
? 999997
? 1
? 999998
! 999998

result:

ok Correct position at 999998

Test #41:

score: 0
Accepted
time: 474ms
memory: 50464kb

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
? 992185
? 3907
? 996091
? 1954
? 998044
? 977
? 999021
? 489
? 999509
? 245
? 999753
? 123
? 999875
? 62
? 999936
? 31
? 999967
? 16
? 999982
? 8
? 999990
? 4
? 999994
? 2
? 999996
? 1
? 999997
! 999997

result:

ok Correct position at 999997

Test #42:

score: 0
Accepted
time: 472ms
memory: 50452kb

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
? 750000
? 125001
? 875000
? 62501
? 937500
? 31251
? 968750
? 15626
? 984375
? 7813
? 992188
? 3907
? 996094
? 1954
? 998047
? 977
? 999024
? 489
? 999512
? 245
? 999756
? 123
? 999878
? 62
? 999939
? 31
? 999970
? 16
? 999985
? 8
? 999993
? 4
? 999997
? 2
? 999999
? 1
? 1000000
! 1000000

result:

ok Correct position at 1000000

Test #43:

score: 0
Accepted
time: 479ms
memory: 50480kb

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
? 750000
? 125001
? 875000
? 62501
? 937500
? 31251
? 968750
? 15626
? 984375
? 7813
? 992188
? 3907
? 996094
? 1954
? 998047
? 977
? 999024
? 489
? 999512
? 245
? 999756
? 123
? 999878
? 62
? 999939
? 31
? 999970
? 16
? 999985
? 8
? 999993
? 4
? 999997
? 2
? 999999
? 1
! 1

result:

ok Correct position at 1