QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#525302#6394. Turn on the LightMaMengQiAC ✓1ms3952kbC++201.3kb2024-08-20 15:23:242024-08-20 15:23:24

詳細信息

Test #1:

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

input:

3
1
2
2

output:

? 1
? 2
? 3
! 3

result:

ok Correct position at 3

Test #2:

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

input:

10
1
0
1
0
0

output:

? 1
? 6
? 2
? 4
? 3
! 3

result:

ok Correct position at 3

Test #3:

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

input:

9
1
2
1
0
0

output:

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

result:

ok Correct position at 6

Test #4:

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

input:

8
1
0
1
1

output:

? 1
? 5
? 2
? 3
! 3

result:

ok Correct position at 3

Test #5:

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

input:

7
1
2
1
1

output:

? 1
? 4
? 7
? 5
! 5

result:

ok Correct position at 5

Test #6:

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

input:

6
1
0
1
1

output:

? 1
? 4
? 2
? 3
! 3

result:

ok Correct position at 3

Test #7:

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

input:

5
1
2
2

output:

? 1
? 3
? 5
! 5

result:

ok Correct position at 5

Test #8:

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

input:

4
1
1

output:

? 1
? 3
! 3

result:

ok Correct position at 3

Test #9:

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

input:

3
1
1

output:

? 1
? 2
! 2

result:

ok Correct position at 2

Test #10:

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

input:

2
1
1

output:

? 1
? 2
! 2

result:

ok Correct position at 2

Test #11:

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

input:

1
0

output:

? 1
! 1

result:

ok Correct position at 1

Test #12:

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

input:

1000000
1
0
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
0
1
2
1
2
1
2
1
2
1
2
1
2
1
0
1
2
1
1

output:

? 1
? 500001
? 2
? 250001
? 500000
? 375000
? 499999
? 437499
? 499998
? 468748
? 499997
? 484372
? 499996
? 492184
? 499995
? 496089
? 499994
? 498041
? 499993
? 499017
? 498042
? 498529
? 499016
? 498772
? 499015
? 498893
? 499014
? 498953
? 499013
? 498983
? 499012
? 498997
? 499011
? 499004
? 49...

result:

ok Correct position at 499002

Test #13:

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

input:

999999
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
0
1
2
1
2
1
2
1
2
1
2
1
2
1
0
1
2
1
1

output:

? 1
? 500000
? 999999
? 749999
? 999998
? 874998
? 999997
? 937497
? 999996
? 968746
? 999995
? 984370
? 999994
? 992182
? 999993
? 996087
? 999992
? 998039
? 999991
? 999015
? 998040
? 998527
? 999014
? 998770
? 999013
? 998891
? 999012
? 998951
? 999011
? 998981
? 999010
? 998995
? 999009
? 999002...

result:

ok Correct position at 999000

Test #14:

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

input:

999998
1
0
1
0
1
0
1
0
1
2
1
0
1
2
1
2
1
2
1
0
1
2
1
2
1
2
1
2
1
2
1
2
1
0
1
2
1
1

output:

? 1
? 500000
? 2
? 250001
? 3
? 125002
? 4
? 62503
? 5
? 31254
? 62502
? 46878
? 31255
? 39066
? 46877
? 42971
? 46876
? 44923
? 46875
? 45899
? 44924
? 45411
? 45898
? 45654
? 45897
? 45775
? 45896
? 45835
? 45895
? 45865
? 45894
? 45879
? 45893
? 45886
? 45880
? 45883
? 45885
? 45884
! 45884

result:

ok Correct position at 45884

Test #15:

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

input:

999997
1
2
1
0
1
0
1
0
1
2
1
0
1
2
1
2
1
2
1
0
1
2
1
2
1
2
1
2
1
2
1
2
1
0
1
2
1
1

output:

? 1
? 499999
? 999997
? 749998
? 500000
? 624999
? 500001
? 562500
? 500002
? 531251
? 562499
? 546875
? 531252
? 539063
? 546874
? 542968
? 546873
? 544920
? 546872
? 545896
? 544921
? 545408
? 545895
? 545651
? 545894
? 545772
? 545893
? 545832
? 545892
? 545862
? 545891
? 545876
? 545890
? 545883...

result:

ok Correct position at 545881

Test #16:

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

input:

999996
1
0
1
2
1
0
1
0
1
2
1
0
1
2
1
2
1
2
1
0
1
2
1
2
1
2
1
2
1
2
1
2
1
0
1
2
1
1

output:

? 1
? 499999
? 2
? 250000
? 499998
? 374999
? 250001
? 312500
? 250002
? 281251
? 312499
? 296875
? 281252
? 289063
? 296874
? 292968
? 296873
? 294920
? 296872
? 295896
? 294921
? 295408
? 295895
? 295651
? 295894
? 295772
? 295893
? 295832
? 295892
? 295862
? 295891
? 295876
? 295890
? 295883
? 29...

result:

ok Correct position at 295881

Test #17:

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

input:

999995
1
2
1
2
1
0
1
0
1
2
1
0
1
2
1
2
1
2
1
0
1
2
1
2
1
2
1
2
1
2
1
2
1
0
1
2
1
1

output:

? 1
? 499998
? 999995
? 749996
? 999994
? 874995
? 749997
? 812496
? 749998
? 781247
? 812495
? 796871
? 781248
? 789059
? 796870
? 792964
? 796869
? 794916
? 796868
? 795892
? 794917
? 795404
? 795891
? 795647
? 795890
? 795768
? 795889
? 795828
? 795888
? 795858
? 795887
? 795872
? 795886
? 795879...

result:

ok Correct position at 795877

Test #18:

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

input:

999994
1
0
1
0
1
2
1
0
1
2
1
0
1
2
1
2
1
2
1
0
1
2
1
2
1
2
1
2
1
2
1
2
1
0
1
2
1
1

output:

? 1
? 499998
? 2
? 250000
? 3
? 125001
? 249999
? 187500
? 125002
? 156251
? 187499
? 171875
? 156252
? 164063
? 171874
? 167968
? 171873
? 169920
? 171872
? 170896
? 169921
? 170408
? 170895
? 170651
? 170894
? 170772
? 170893
? 170832
? 170892
? 170862
? 170891
? 170876
? 170890
? 170883
? 170877
...

result:

ok Correct position at 170881

Test #19:

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

input:

999993
1
2
1
0
1
2
1
0
1
2
1
0
1
2
1
2
1
2
1
0
1
2
1
2
1
2
1
2
1
2
1
2
1
0
1
2
1
1

output:

? 1
? 499997
? 999993
? 749995
? 499998
? 624996
? 749994
? 687495
? 624997
? 656246
? 687494
? 671870
? 656247
? 664058
? 671869
? 667963
? 671868
? 669915
? 671867
? 670891
? 669916
? 670403
? 670890
? 670646
? 670889
? 670767
? 670888
? 670827
? 670887
? 670857
? 670886
? 670871
? 670885
? 670878...

result:

ok Correct position at 670876

Test #20:

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

input:

999992
1
0
1
2
1
2
1
0
1
2
1
0
1
2
1
2
1
2
1
0
1
2
1
2
1
2
1
2
1
2
1
2
1
0
1
2
1
1

output:

? 1
? 499997
? 2
? 249999
? 499996
? 374997
? 499995
? 437496
? 374998
? 406247
? 437495
? 421871
? 406248
? 414059
? 421870
? 417964
? 421869
? 419916
? 421868
? 420892
? 419917
? 420404
? 420891
? 420647
? 420890
? 420768
? 420889
? 420828
? 420888
? 420858
? 420887
? 420872
? 420886
? 420879
? 42...

result:

ok Correct position at 420877

Test #21:

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

input:

999991
1
2
1
2
1
2
1
0
1
2
1
0
1
2
1
2
1
2
1
0
1
2
1
2
1
2
1
2
1
2
1
2
1
0
1
2
1
1

output:

? 1
? 499996
? 999991
? 749993
? 999990
? 874991
? 999989
? 937490
? 874992
? 906241
? 937489
? 921865
? 906242
? 914053
? 921864
? 917958
? 921863
? 919910
? 921862
? 920886
? 919911
? 920398
? 920885
? 920641
? 920884
? 920762
? 920883
? 920822
? 920882
? 920852
? 920881
? 920866
? 920880
? 920873...

result:

ok Correct position at 920871

Test #22:

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

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

output:

? 1
? 500001
? 2
? 250001
? 3
? 125002
? 4
? 62503
? 5
? 31254
? 6
? 15630
? 7
? 7818
? 8
? 3913
? 9
? 1961
? 10
? 985
? 11
? 498
? 12
? 255
? 13
? 134
? 14
? 74
? 15
? 44
? 16
? 30
? 43
! 43

result:

ok Correct position at 43

Test #23:

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

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

output:

? 1
? 500000
? 2
? 250001
? 3
? 125002
? 4
? 62503
? 5
? 31254
? 6
? 15630
? 7
? 7818
? 8
? 3913
? 9
? 1961
? 10
? 985
? 11
? 498
? 12
? 255
? 13
? 134
? 14
? 74
? 15
? 44
? 73
? 58
? 45
? 51
! 51

result:

ok Correct position at 51

Test #24:

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

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

output:

? 1
? 500000
? 2
? 250001
? 3
? 125002
? 4
? 62503
? 5
? 31254
? 6
? 15630
? 7
? 7818
? 8
? 3913
? 9
? 1961
? 10
? 985
? 11
? 498
? 12
? 255
? 13
? 134
? 14
? 74
? 15
? 44
? 73
? 58
? 45
? 51
! 51

result:

ok Correct position at 51

Test #25:

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

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

output:

? 1
? 499999
? 2
? 250000
? 3
? 125001
? 4
? 62502
? 5
? 31253
? 6
? 15629
? 7
? 7818
? 8
? 3913
? 9
? 1961
? 10
? 985
? 11
? 498
? 12
? 255
? 13
? 134
? 14
? 74
? 15
? 44
? 73
? 58
? 45
? 51
! 51

result:

ok Correct position at 51

Test #26:

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

input:

1000000
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
0
1
0
1
2
1
0
1
0
1
1

output:

? 1
? 500001
? 1000000
? 750000
? 999999
? 874999
? 999998
? 937498
? 999997
? 968747
? 999996
? 984371
? 999995
? 992183
? 999994
? 996088
? 999993
? 998040
? 999992
? 999016
? 999991
? 999503
? 999990
? 999746
? 999989
? 999867
? 999747
? 999807
? 999748
? 999777
? 999806
? 999791
? 999778
? 99978...

result:

ok Correct position at 999781

Test #27:

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

input:

999999
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
1

output:

? 1
? 500000
? 999999
? 749999
? 999998
? 874998
? 999997
? 937497
? 999996
? 968746
? 999995
? 984370
? 999994
? 992182
? 999993
? 996087
? 999992
? 998039
? 999991
? 999015
? 999990
? 999502
? 999989
? 999745
? 999988
? 999866
? 999987
? 999926
? 999986
? 999956
? 999985
? 999970
? 999984
? 999977...

result:

ok Correct position at 999980

Test #28:

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

input:

999998
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
1

output:

? 1
? 500000
? 999998
? 749999
? 999997
? 874998
? 999996
? 937497
? 999995
? 968746
? 999994
? 984370
? 999993
? 992181
? 999992
? 996086
? 999991
? 998038
? 999990
? 999014
? 999989
? 999501
? 999988
? 999744
? 999987
? 999865
? 999986
? 999925
? 999985
? 999955
? 999984
? 999969
? 999983
? 999976...

result:

ok Correct position at 999979

Test #29:

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

input:

999997
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
1

output:

? 1
? 499999
? 999997
? 749998
? 999996
? 874997
? 999995
? 937496
? 999994
? 968745
? 999993
? 984369
? 999992
? 992180
? 999991
? 996085
? 999990
? 998037
? 999989
? 999013
? 999988
? 999500
? 999987
? 999743
? 999986
? 999864
? 999985
? 999924
? 999984
? 999954
? 999983
? 999968
? 999982
? 999975...

result:

ok Correct position at 999978

Test #30:

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

input:

1000000
1
0
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
0
1
2
1
0
1
1

output:

? 1
? 500001
? 2
? 250001
? 500000
? 375000
? 499999
? 437499
? 499998
? 468748
? 499997
? 484372
? 499996
? 492184
? 499995
? 496089
? 499994
? 498041
? 499993
? 499017
? 499992
? 499504
? 499991
? 499747
? 499990
? 499868
? 499989
? 499928
? 499988
? 499958
? 499929
? 499943
? 499957
? 499950
? 49...

result:

ok Correct position at 499947

Test #31:

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

input:

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

? 1
? 500000
? 999999
? 749999
? 500001
? 625000
? 500002
? 562501
? 500003
? 531252
? 500004
? 515628
? 500005
? 507816
? 500006
? 503911
? 500007
? 501959
? 500008
? 500983
? 500009
? 500496
? 500010
? 500253
? 500011
? 500132
? 500012
? 500072
? 500013
? 500042
? 500071
? 500056
? 500070
! 500070

result:

ok Correct position at 500070

Test #32:

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

input:

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

output:

? 1
? 500000
? 999998
? 749999
? 500001
? 625000
? 500002
? 562501
? 500003
? 531252
? 500004
? 515628
? 500005
? 507816
? 500006
? 503911
? 500007
? 501959
? 500008
? 500983
? 500009
? 500496
? 500010
? 500253
? 500011
? 500132
? 500012
? 500072
? 500131
? 500101
? 500073
? 500087
? 500074
? 500080...

result:

ok Correct position at 500076

Test #33:

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

input:

999997
1
0
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
0
1
2
1
0
1
1

output:

? 1
? 499999
? 2
? 250000
? 499998
? 374999
? 499997
? 437498
? 499996
? 468747
? 499995
? 484371
? 499994
? 492182
? 499993
? 496087
? 499992
? 498039
? 499991
? 499015
? 499990
? 499502
? 499989
? 499745
? 499988
? 499866
? 499987
? 499926
? 499986
? 499956
? 499985
? 499970
? 499957
? 499963
? 49...

result:

ok Correct position at 499965

Test #34:

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

input:

1000000
1
0
1
2
1
2
1
2
1
2
1
2
1
0
1
2
1
2
1
0
1
2
1
2
1
2
1
2
1
0
1
2
1
0
1
0
0

output:

? 1
? 500001
? 2
? 250001
? 500000
? 375000
? 499999
? 437499
? 499998
? 468748
? 499997
? 484372
? 499996
? 492184
? 484373
? 488278
? 492183
? 490230
? 492182
? 491206
? 490231
? 490718
? 491205
? 490961
? 491204
? 491082
? 491203
? 491142
? 491202
? 491172
? 491143
? 491157
? 491171
? 491164
? 49...

result:

ok Correct position at 491159

Test #35:

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

input:

999999
1
2
1
2
1
2
1
2
1
2
1
2
1
0
1
2
1
2
1
0
1
2
1
2
1
2
1
2
1
0
1
2
1
0
1
0
0

output:

? 1
? 500000
? 999999
? 749999
? 999998
? 874998
? 999997
? 937497
? 999996
? 968746
? 999995
? 984370
? 999994
? 992182
? 984371
? 988276
? 992181
? 990228
? 992180
? 991204
? 990229
? 990716
? 991203
? 990959
? 991202
? 991080
? 991201
? 991140
? 991200
? 991170
? 991141
? 991155
? 991169
? 991162...

result:

ok Correct position at 991157

Test #36:

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

input:

999998
1
0
1
0
1
0
1
0
1
0
1
0
1
2
1
2
1
2
1
0
1
2
1
2
1
2
1
2
1
0
1
2
1
0
1
0
0

output:

? 1
? 500000
? 2
? 250001
? 3
? 125002
? 4
? 62503
? 5
? 31254
? 6
? 15630
? 7
? 7818
? 15629
? 11723
? 15628
? 13675
? 15627
? 14651
? 13676
? 14163
? 14650
? 14406
? 14649
? 14527
? 14648
? 14587
? 14647
? 14617
? 14588
? 14602
? 14616
? 14609
? 14603
? 14606
? 14604
! 14604

result:

ok Correct position at 14604

Test #37:

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

input:

999997
1
2
1
0
1
0
1
0
1
0
1
0
1
2
1
2
1
2
1
0
1
2
1
2
1
2
1
2
1
0
1
2
1
0
1
0
0

output:

? 1
? 499999
? 999997
? 749998
? 500000
? 624999
? 500001
? 562500
? 500002
? 531251
? 500003
? 515627
? 500004
? 507815
? 515626
? 511720
? 515625
? 513672
? 515624
? 514648
? 513673
? 514160
? 514647
? 514403
? 514646
? 514524
? 514645
? 514584
? 514644
? 514614
? 514585
? 514599
? 514613
? 514606...

result:

ok Correct position at 514601

Test #38:

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

input:

1000000
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
2

output:

? 1
? 500001
? 1000000
? 750000
? 999999
? 874999
? 999998
? 937498
? 999997
? 968747
? 999996
? 984371
? 999995
? 992183
? 999994
? 996088
? 999993
? 998040
? 999992
? 999016
? 999991
? 999503
? 999990
? 999746
? 999989
? 999867
? 999988
? 999927
? 999987
? 999957
? 999986
? 999971
? 999985
? 99997...

result:

ok Correct position at 999983

Test #39:

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

input:

999999
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
2

output:

? 1
? 500000
? 999999
? 749999
? 999998
? 874998
? 999997
? 937497
? 999996
? 968746
? 999995
? 984370
? 999994
? 992182
? 999993
? 996087
? 999992
? 998039
? 999991
? 999015
? 999990
? 999502
? 999989
? 999745
? 999988
? 999866
? 999987
? 999926
? 999986
? 999956
? 999985
? 999970
? 999984
? 999977...

result:

ok Correct position at 999982

Test #40:

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

input:

999998
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
2

output:

? 1
? 500000
? 999998
? 749999
? 999997
? 874998
? 999996
? 937497
? 999995
? 968746
? 999994
? 984370
? 999993
? 992181
? 999992
? 996086
? 999991
? 998038
? 999990
? 999014
? 999989
? 999501
? 999988
? 999744
? 999987
? 999865
? 999986
? 999925
? 999985
? 999955
? 999984
? 999969
? 999983
? 999976...

result:

ok Correct position at 999981

Test #41:

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

input:

999997
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
2

output:

? 1
? 499999
? 999997
? 749998
? 999996
? 874997
? 999995
? 937496
? 999994
? 968745
? 999993
? 984369
? 999992
? 992180
? 999991
? 996085
? 999990
? 998037
? 999989
? 999013
? 999988
? 999500
? 999987
? 999743
? 999986
? 999864
? 999985
? 999924
? 999984
? 999954
? 999983
? 999968
? 999982
? 999975...

result:

ok Correct position at 999980

Test #42:

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

input:

1000000
1
2
2

output:

? 1
? 500001
? 1000000
! 1000000

result:

ok Correct position at 1000000

Test #43:

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

input:

1000000
0

output:

? 1
! 1

result:

ok Correct position at 1