QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#183343#6394. Turn on the Lightucup-team1052#AC ✓1ms3704kbC++171.1kb2023-09-19 13:58:392023-09-19 13:58:39

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

3
1
1

output:

? 1
? 3
! 3

result:

ok Correct position at 3

Test #2:

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

input:

10
1
0
1
0
0

output:

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

result:

ok Correct position at 5

Test #3:

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

input:

9
1
2
3
4
5
5

output:

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

result:

ok Correct position at 9

Test #4:

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

input:

8
1
0
1
0
0

output:

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

result:

ok Correct position at 4

Test #5:

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

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

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

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

input:

4
1
1

output:

? 1
? 3
! 3

result:

ok Correct position at 3

Test #9:

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

input:

3
1
0
0

output:

? 1
? 3
? 2
! 2

result:

ok Correct position at 2

Test #10:

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

input:

2
1
1

output:

? 1
? 2
! 2

result:

ok Correct position at 2

Test #11:

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

input:

1
0

output:

? 1
! 1

result:

ok Correct position at 1

Test #12:

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

input:

1000000
1
0
1
0
1
0
1
0
1
0
1
2
3
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
4

output:

? 250000
? 750000
? 375000
? 625000
? 437500
? 562500
? 468750
? 531250
? 484375
? 515625
? 492188
? 507812
? 484376
? 492187
? 509765
? 513671
? 510742
? 512694
? 511230
? 512206
? 511474
? 511962
? 511596
? 511840
? 511657
? 511779
? 511688
? 511748
? 511703
? 511733
? 511711
? 511725
? 511715
? 5...

result:

ok Correct position at 511718

Test #13:

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

input:

999999
1
0
1
0
1
0
1
0
1
0
1
2
3
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
4

output:

? 250000
? 750000
? 375000
? 625000
? 437500
? 562500
? 468750
? 531250
? 484375
? 515625
? 492188
? 507812
? 484376
? 492187
? 509765
? 513671
? 510742
? 512694
? 511230
? 512206
? 511474
? 511962
? 511596
? 511840
? 511657
? 511779
? 511688
? 511748
? 511703
? 511733
? 511711
? 511725
? 511715
? 5...

result:

ok Correct position at 511718

Test #14:

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

input:

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

output:

? 250000
? 749999
? 375000
? 624999
? 437500
? 562499
? 468750
? 531249
? 484375
? 515624
? 468751
? 484374
? 519530
? 527342
? 521483
? 525389
? 522460
? 524412
? 522948
? 523924
? 523192
? 523680
? 523314
? 523558
? 523375
? 523497
? 523406
? 523466
? 523421
? 523451
? 523429
? 523443
? 523433
? 5...

result:

ok Correct position at 523436

Test #15:

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

input:

999997
1
2
3
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
4

output:

? 250000
? 749998
? 1
? 249999
? 812498
? 937498
? 843748
? 906248
? 859373
? 890623
? 867186
? 882810
? 871092
? 878904
? 873045
? 876951
? 874022
? 875974
? 874510
? 875486
? 874754
? 875242
? 874876
? 875120
? 874937
? 875059
? 874968
? 875028
? 874983
? 875013
? 874991
? 875005
? 874995
? 875001...

result:

ok Correct position at 874998

Test #16:

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

input:

999996
1
0
1
2
3
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
4

output:

? 249999
? 749997
? 374999
? 624997
? 250000
? 374998
? 656247
? 718747
? 671872
? 703122
? 679685
? 695309
? 683591
? 691403
? 685544
? 689450
? 686521
? 688473
? 687009
? 687985
? 687253
? 687741
? 687375
? 687619
? 687436
? 687558
? 687467
? 687527
? 687482
? 687512
? 687490
? 687504
? 687494
? 6...

result:

ok Correct position at 687497

Test #17:

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

input:

999995
1
0
1
2
3
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
4

output:

? 249999
? 749997
? 374999
? 624997
? 250000
? 374998
? 656247
? 718747
? 671872
? 703122
? 679685
? 695309
? 683591
? 691403
? 685544
? 689450
? 686521
? 688473
? 687009
? 687985
? 687253
? 687741
? 687375
? 687619
? 687436
? 687558
? 687467
? 687527
? 687482
? 687512
? 687490
? 687504
? 687494
? 6...

result:

ok Correct position at 687497

Test #18:

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

input:

999994
1
0
1
0
1
2
3
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
4

output:

? 249999
? 749996
? 374998
? 624996
? 437498
? 562496
? 374999
? 437497
? 578121
? 609371
? 585934
? 601558
? 589840
? 597652
? 591793
? 595699
? 592770
? 594722
? 593258
? 594234
? 593502
? 593990
? 593624
? 593868
? 593685
? 593807
? 593716
? 593776
? 593731
? 593761
? 593739
? 593753
? 593743
? 5...

result:

ok Correct position at 593746

Test #19:

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

input:

999993
1
2
3
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
4

output:

? 249999
? 749995
? 1
? 249998
? 812495
? 937494
? 843745
? 906244
? 859370
? 890619
? 867182
? 882806
? 871088
? 878900
? 873041
? 876947
? 874018
? 875970
? 874506
? 875482
? 874750
? 875238
? 874872
? 875116
? 874933
? 875055
? 874964
? 875024
? 874979
? 875009
? 874987
? 875001
? 874991
? 874997...

result:

ok Correct position at 874994

Test #20:

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

input:

999992
1
0
1
0
1
2
3
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
4

output:

? 249998
? 749994
? 374997
? 624995
? 437497
? 562495
? 374998
? 437496
? 578120
? 609370
? 585933
? 601557
? 589839
? 597651
? 591792
? 595698
? 592769
? 594721
? 593257
? 594233
? 593501
? 593989
? 593623
? 593867
? 593684
? 593806
? 593715
? 593775
? 593730
? 593760
? 593738
? 593752
? 593742
? 5...

result:

ok Correct position at 593745

Test #21:

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

input:

999991
1
0
1
0
1
2
3
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
4

output:

? 249998
? 749994
? 374997
? 624995
? 437497
? 562495
? 374998
? 437496
? 578120
? 609370
? 585933
? 601557
? 589839
? 597651
? 591792
? 595698
? 592769
? 594721
? 593257
? 594233
? 593501
? 593989
? 593623
? 593867
? 593684
? 593806
? 593715
? 593775
? 593730
? 593760
? 593738
? 593752
? 593742
? 5...

result:

ok Correct position at 593745

Test #22:

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

input:

1000000
1
2
1
2
3
4
3
4
5
6
5
6
7
8
7
8
9
10
9
10
11
12
11
12
13
14
13
14
13
14
13
13

output:

? 250000
? 750000
? 1
? 249999
? 62501
? 187499
? 2
? 62500
? 15627
? 46875
? 3
? 15626
? 3909
? 11720
? 4
? 3908
? 980
? 2932
? 5
? 979
? 249
? 735
? 6
? 248
? 67
? 187
? 7
? 66
? 22
? 51
? 29
? 43
! 43

result:

ok Correct position at 43

Test #23:

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

input:

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

output:

? 250000
? 750000
? 1
? 249999
? 62501
? 187499
? 2
? 62500
? 15627
? 46875
? 3
? 15626
? 3909
? 11720
? 4
? 3908
? 980
? 2932
? 5
? 979
? 249
? 735
? 6
? 248
? 67
? 187
? 7
? 66
? 22
? 51
! 51

result:

ok Correct position at 51

Test #24:

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

input:

999998
1
2
1
2
3
4
3
4
5
6
5
6
7
8
7
8
9
10
9
10
11
12
11
12
13
14
13
14
13
13

output:

? 250000
? 749999
? 1
? 249999
? 62501
? 187499
? 2
? 62500
? 15627
? 46875
? 3
? 15626
? 3909
? 11720
? 4
? 3908
? 980
? 2932
? 5
? 979
? 249
? 735
? 6
? 248
? 67
? 187
? 7
? 66
? 22
? 51
! 51

result:

ok Correct position at 51

Test #25:

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

input:

999997
1
2
1
2
3
4
3
4
5
6
5
6
7
8
7
8
9
10
9
10
11
12
11
12
13
14
13
14
13
13

output:

? 250000
? 749998
? 1
? 249999
? 62501
? 187499
? 2
? 62500
? 15627
? 46875
? 3
? 15626
? 3909
? 11720
? 4
? 3908
? 980
? 2932
? 5
? 979
? 249
? 735
? 6
? 248
? 67
? 187
? 7
? 66
? 22
? 51
! 51

result:

ok Correct position at 51

Test #26:

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

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

output:

? 250000
? 750000
? 1
? 249999
? 812500
? 937500
? 750001
? 812499
? 953125
? 984375
? 937501
? 953124
? 988282
? 996094
? 984376
? 988281
? 997071
? 999024
? 996095
? 997070
? 999268
? 999756
? 999025
? 999267
? 999817
? 999939
? 999757
? 999816
? 999772
? 999801
? 999779
? 999793
? 999783
? 999789...

result:

ok Correct position at 999781

Test #27:

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

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

output:

? 250000
? 750000
? 1
? 249999
? 812500
? 937500
? 750001
? 812499
? 953125
? 984375
? 937501
? 953124
? 988281
? 996093
? 984376
? 988280
? 997070
? 999023
? 996094
? 997069
? 999267
? 999755
? 999024
? 999266
? 999816
? 999938
? 999756
? 999815
? 999954
? 999984
? 999962
? 999976
? 999955
? 999961...

result:

ok Correct position at 999980

Test #28:

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

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

output:

? 250000
? 749999
? 1
? 249999
? 812499
? 937499
? 750000
? 812498
? 953124
? 984374
? 937500
? 953123
? 988280
? 996092
? 984375
? 988279
? 997069
? 999022
? 996093
? 997068
? 999266
? 999754
? 999023
? 999265
? 999815
? 999937
? 999755
? 999814
? 999953
? 999983
? 999961
? 999975
? 999954
? 999960...

result:

ok Correct position at 999979

Test #29:

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

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

output:

? 250000
? 749998
? 1
? 249999
? 812498
? 937498
? 749999
? 812497
? 953123
? 984373
? 937499
? 953122
? 988279
? 996091
? 984374
? 988278
? 997068
? 999021
? 996092
? 997067
? 999265
? 999753
? 999022
? 999264
? 999814
? 999936
? 999754
? 999813
? 999952
? 999982
? 999960
? 999974
? 999953
? 999959...

result:

ok Correct position at 999978

Test #30:

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

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

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
? 499970
? 500030
? 499940
? 499969
? 499947
! 499947

result:

ok Correct position at 499947

Test #31:

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

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
4
3
2
3
2
3
2
3
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
? 499879
? 499938
? 500076
? 500106
? 500062
? 500075
? 500065
? 5...

result:

ok Correct position at 500070

Test #32:

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

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

output:

? 250000
? 749999
? 375000
? 624999
? 437500
? 562499
? 468750
? 531249
? 484375
? 515624
? 492187
? 507811
? 496093
? 503905
? 498046
? 501952
? 499023
? 500975
? 499511
? 500487
? 499755
? 500243
? 499877
? 500121
? 499938
? 500060
? 499878
? 499937
? 500075
? 500105
? 500083
? 500097
? 500076
! 5...

result:

ok Correct position at 500076

Test #33:

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

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

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
? 499939
? 499968
? 499946
? 499960
? 499940
? 4...

result:

ok Correct position at 499965

Test #34:

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

input:

1000000
1
0
1
0
1
0
1
0
1
0
1
2
3
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
4

output:

? 250000
? 750000
? 375000
? 625000
? 437500
? 562500
? 468750
? 531250
? 484375
? 515625
? 492188
? 507812
? 484376
? 492187
? 509765
? 513671
? 510742
? 512694
? 511230
? 512206
? 511474
? 511962
? 511596
? 511840
? 511657
? 511779
? 511688
? 511748
? 511703
? 511733
? 511711
? 511725
? 511715
? 5...

result:

ok Correct position at 511718

Test #35:

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

input:

999999
1
0
1
0
1
0
1
0
1
0
1
2
3
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
4

output:

? 250000
? 750000
? 375000
? 625000
? 437500
? 562500
? 468750
? 531250
? 484375
? 515625
? 492188
? 507812
? 484376
? 492187
? 509765
? 513671
? 510742
? 512694
? 511230
? 512206
? 511474
? 511962
? 511596
? 511840
? 511657
? 511779
? 511688
? 511748
? 511703
? 511733
? 511711
? 511725
? 511715
? 5...

result:

ok Correct position at 511718

Test #36:

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

input:

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

output:

? 250000
? 749999
? 375000
? 624999
? 437500
? 562499
? 468750
? 531249
? 484375
? 515624
? 492187
? 507811
? 496093
? 503905
? 498046
? 501952
? 499023
? 500975
? 498047
? 499022
? 501219
? 501707
? 501341
? 501585
? 501402
? 501524
? 501433
? 501493
? 501448
? 501478
? 501456
? 501470
? 501460
? 5...

result:

ok Correct position at 501463

Test #37:

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

input:

999997
1
2
3
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
4

output:

? 250000
? 749998
? 1
? 249999
? 812498
? 937498
? 843748
? 906248
? 859373
? 890623
? 867186
? 882810
? 871092
? 878904
? 873045
? 876951
? 874022
? 875974
? 874510
? 875486
? 874754
? 875242
? 874876
? 875120
? 874937
? 875059
? 874968
? 875028
? 874983
? 875013
? 874991
? 875005
? 874995
? 875001...

result:

ok Correct position at 874998

Test #38:

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

input:

1000000
1
2
3
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
6
7
7

output:

? 250000
? 750000
? 1
? 249999
? 812500
? 937500
? 843750
? 906250
? 859375
? 890625
? 867188
? 882812
? 871094
? 878906
? 873047
? 876953
? 874024
? 875976
? 874512
? 875488
? 874756
? 875244
? 874878
? 875122
? 874939
? 875061
? 874970
? 875030
? 874985
? 875015
? 874993
? 875007
? 874997
? 875003...

result:

ok Correct position at 875002

Test #39:

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

input:

999999
1
0
1
0
1
0
1
0
1
0
1
2
3
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
6
7
7

output:

? 250000
? 750000
? 375000
? 625000
? 437500
? 562500
? 468750
? 531250
? 484375
? 515625
? 492188
? 507812
? 484376
? 492187
? 509765
? 513671
? 510742
? 512694
? 511230
? 512206
? 511474
? 511962
? 511596
? 511840
? 511657
? 511779
? 511688
? 511748
? 511703
? 511733
? 511711
? 511725
? 511715
? 5...

result:

ok Correct position at 511720

Test #40:

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

input:

999998
1
2
3
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
6
7
7

output:

? 250000
? 749999
? 1
? 249999
? 812499
? 937499
? 843749
? 906249
? 859374
? 890624
? 867187
? 882811
? 871093
? 878905
? 873046
? 876952
? 874023
? 875975
? 874511
? 875487
? 874755
? 875243
? 874877
? 875121
? 874938
? 875060
? 874969
? 875029
? 874984
? 875014
? 874992
? 875006
? 874996
? 875002...

result:

ok Correct position at 875001

Test #41:

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

input:

999997
1
2
3
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
6
7
7

output:

? 250000
? 749998
? 1
? 249999
? 812498
? 937498
? 843748
? 906248
? 859373
? 890623
? 867186
? 882810
? 871092
? 878904
? 873045
? 876951
? 874022
? 875974
? 874510
? 875486
? 874754
? 875242
? 874876
? 875120
? 874937
? 875059
? 874968
? 875028
? 874983
? 875013
? 874991
? 875005
? 874995
? 875001...

result:

ok Correct position at 875000

Test #42:

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:

? 250000
? 750000
? 1
? 249999
? 812500
? 937500
? 750001
? 812499
? 953125
? 984375
? 937501
? 953124
? 988282
? 996094
? 984376
? 988281
? 997071
? 999024
? 996095
? 997070
? 999268
? 999756
? 999025
? 999267
? 999817
? 999939
? 999757
? 999816
? 999955
? 999985
? 999940
? 999954
? 999989
? 999997...

result:

ok Correct position at 1000000

Test #43:

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

input:

1000000
1
2
2

output:

? 250000
? 750000
? 1
! 1

result:

ok Correct position at 1