QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#391187#4884. Battleship: New Ruleszaozao_zmxAC ✓55ms50020kbC++144.3kb2024-04-16 14:28:112024-04-16 14:28:11

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 3ms
memory: 28572kb

input:

2
3
1
4
1
1
0
1
0
0
0
1
1
0
0
0
1
0
1
1
1

output:

! -1 -1
? 1 1
? 1 2
? 1 3
? 1 4
? 2 1
? 2 2
? 2 3
? 2 4
? 3 1
? 3 2
? 3 3
? 3 4
? 4 1
? 4 2
? 4 3
? 4 4
! 2 2

result:

ok max_C=4.00, avg_C=2.00 (2 test cases)

Test #2:

score: 0
Accepted
time: 7ms
memory: 28444kb

input:

100
4
1
1
0
1
0
0
0
1
1
0
0
0
1
0
1
1
1
4
1
1
0
1
0
0
0
1
1
0
0
0
1
0
1
1
1
4
1
0
1
1
1
0
0
0
0
0
0
1
1
1
0
1
1
4
1
0
1
1
1
0
0
0
0
0
0
1
1
1
0
1
1
4
1
1
0
1
0
0
0
1
1
0
0
0
1
0
1
1
1
4
1
1
0
1
0
0
0
1
1
0
0
0
1
0
1
1
1
4
1
1
0
1
0
0
0
1
1
0
0
0
1
0
1
1
1
4
1
0
1
1
1
0
0
0
0
0
0
1
1
1
0
1
1
4
1
0
1
...

output:

? 1 1
? 1 2
? 1 3
? 1 4
? 2 1
? 2 2
? 2 3
? 2 4
? 3 1
? 3 2
? 3 3
? 3 4
? 4 1
? 4 2
? 4 3
? 4 4
! 2 2
? 1 1
? 1 2
? 1 3
? 1 4
? 2 1
? 2 2
? 2 3
? 2 4
? 3 1
? 3 2
? 3 3
? 3 4
? 4 1
? 4 2
? 4 3
? 4 4
! 2 2
? 1 1
? 1 2
? 1 3
? 1 4
? 2 1
? 2 2
? 2 3
? 2 4
? 3 1
? 3 2
? 3 3
? 3 4
? 4 1
? 4 2
? 4 3
? 4 4
...

result:

ok max_C=4.00, avg_C=4.00 (100 test cases)

Test #3:

score: 0
Accepted
time: 21ms
memory: 26536kb

input:

100
10
1
0
0
0
0
0
0
1
0
1
0
0
0
1
1
0
1
1
1
0
0
0
1
0
1
1
1
0
0
0
1
10
1
0
1
0
1
0
1
0
1
1
1
0
1
0
1
1
0
1
0
1
0
0
0
0
0
1
1
10
1
0
1
0
1
0
0
0
0
1
0
0
0
0
1
1
0
1
1
1
0
0
0
0
0
1
1
10
1
0
1
0
1
0
1
1
0
1
1
1
1
0
1
0
0
0
0
1
0
0
0
1
0
1
1
10
1
0
1
1
1
1
0
1
0
1
0
0
0
0
0
1
0
0
0
0
1
0
1
0
0
1
1
1
1...

output:

? 1 5
? 2 5
? 3 5
? 4 5
? 5 5
? 6 5
? 7 5
? 8 5
? 9 5
? 10 5
? 5 1
? 5 2
? 5 3
? 5 4
? 1 1
? 1 2
? 1 3
? 1 4
? 2 1
? 2 2
? 2 3
? 2 4
? 3 1
? 3 2
? 3 3
? 3 4
? 4 1
? 4 2
? 4 3
? 4 4
! 4 2
? 1 5
? 2 5
? 3 5
? 4 5
? 5 5
? 6 5
? 7 5
? 8 5
? 9 5
? 10 5
? 5 6
? 5 7
? 5 8
? 5 9
? 5 10
? 6 8
? 7 8
? 8 8
? 9...

result:

ok max_C=3.00, avg_C=2.72 (100 test cases)

Test #4:

score: 0
Accepted
time: 7ms
memory: 26476kb

input:

100
49
1
49
1
49
1
49
1
49
1
49
1
49
1
49
1
49
1
49
1
49
1
49
1
49
1
49
1
49
1
49
1
49
1
49
1
49
1
49
1
49
1
49
1
49
1
49
1
49
1
49
1
49
1
49
1
49
1
49
1
49
1
49
1
49
1
49
1
49
1
49
1
49
1
49
1
49
1
49
1
49
1
49
1
49
1
49
1
49
1
49
1
49
1
49
1
49
1
49
1
49
1
49
1
49
1
49
1
49
1
49
1
49
1
49
1
49
1
4...

output:

! -1 -1
! -1 -1
! -1 -1
! -1 -1
! -1 -1
! -1 -1
! -1 -1
! -1 -1
! -1 -1
! -1 -1
! -1 -1
! -1 -1
! -1 -1
! -1 -1
! -1 -1
! -1 -1
! -1 -1
! -1 -1
! -1 -1
! -1 -1
! -1 -1
! -1 -1
! -1 -1
! -1 -1
! -1 -1
! -1 -1
! -1 -1
! -1 -1
! -1 -1
! -1 -1
! -1 -1
! -1 -1
! -1 -1
! -1 -1
! -1 -1
! -1 -1
! -1 -1
! -1...

result:

ok max_C=0.00, avg_C=0.00 (100 test cases)

Test #5:

score: 0
Accepted
time: 38ms
memory: 26480kb

input:

100
50
1
0
1
1
1
0
1
0
1
0
1
0
1
0
1
0
1
0
0
0
1
0
0
0
1
0
1
0
1
1
1
0
1
0
1
1
1
1
0
1
0
1
0
1
0
0
0
1
0
1
1
1
1
1
1
1
0
1
0
1
0
1
0
1
0
1
1
0
1
0
1
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
1
0
1
0
1
0
1
0
1
1
0
1
0
0
0
0
1
0
1
0
1
1
1
0
1
0
1
0
1
0
1
0
1
1
0
1
1
0
0
0
0
1
0
0
0
0
0
1
0
1
50
1
0
0
0
...

output:

? 1 25
? 2 25
? 3 25
? 4 25
? 5 25
? 6 25
? 7 25
? 8 25
? 9 25
? 10 25
? 11 25
? 12 25
? 13 25
? 14 25
? 15 25
? 16 25
? 17 25
? 18 25
? 19 25
? 20 25
? 21 25
? 22 25
? 23 25
? 24 25
? 25 25
? 26 25
? 27 25
? 28 25
? 29 25
? 30 25
? 31 25
? 32 25
? 33 25
? 34 25
? 35 25
? 36 25
? 37 25
? 38 25
? 39 ...

result:

ok max_C=2.96, avg_C=2.80 (100 test cases)

Test #6:

score: 0
Accepted
time: 15ms
memory: 32540kb

input:

100
31
1
23
1
62
1
0
1
0
1
0
0
0
0
0
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
1
0
1
1
1
1
1
1
1
1
1
1
1
1
0
1
0
0
0
1
0
1
1
0
1
0
1
1
1
1
1
1
1
0
1
0
1
0
1
0
0
0
0
0
0
0
0
1
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0...

output:

! -1 -1
! -1 -1
? 1 31
? 2 31
? 3 31
? 4 31
? 5 31
? 6 31
? 7 31
? 8 31
? 9 31
? 10 31
? 11 31
? 12 31
? 13 31
? 14 31
? 15 31
? 16 31
? 17 31
? 18 31
? 19 31
? 20 31
? 21 31
? 22 31
? 23 31
? 24 31
? 25 31
? 26 31
? 27 31
? 28 31
? 29 31
? 30 31
? 31 31
? 32 31
? 33 31
? 34 31
? 35 31
? 36 31
? 37 ...

result:

ok max_C=3.03, avg_C=1.30 (100 test cases)

Test #7:

score: 0
Accepted
time: 40ms
memory: 28560kb

input:

100
50
1
0
0
0
0
0
0
0
0
0
0
0
1
0
1
0
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
1
0
1
0
1
1
1
1
1
1
1
1
1
1
1
1
0
1
0
1
1
1
1
0
1
0
1
0
1
0
1
1
1
1
1
0
1
0
1
0
1
0
1
0
1
1
1
1
1
1
1
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
0
1
0
0
0
0
0
0
0
0
0
1
0
1
0
0
0
0
1
0
1
0
0
0
0
1
0
1
0
1
0
1
0
0
1
0
1
1
1
0
1
0
0
1
0
0
0
0
1...

output:

? 1 25
? 2 25
? 3 25
? 4 25
? 5 25
? 6 25
? 7 25
? 8 25
? 9 25
? 10 25
? 11 25
? 12 25
? 13 25
? 14 25
? 15 25
? 16 25
? 17 25
? 18 25
? 19 25
? 20 25
? 21 25
? 22 25
? 23 25
? 24 25
? 25 25
? 26 25
? 27 25
? 28 25
? 29 25
? 30 25
? 31 25
? 32 25
? 33 25
? 34 25
? 35 25
? 36 25
? 37 25
? 38 25
? 39 ...

result:

ok max_C=2.96, avg_C=2.84 (100 test cases)

Test #8:

score: 0
Accepted
time: 17ms
memory: 30680kb

input:

100
50
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
0
0
0
0
0
0
0
1
0
1
0
0
0
0
0
1
0
1
0
0
0
1
0
0
0
0
0
1
1
0
1
0
1
0
1
1
0
1
0
0
0
1
0
1
0
1
1
1
0
1
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
1
0
1
0
1
1
1
0
1
0
1
0
1
0
1
0
0
0
0
0
1
0
1
1
0
1
1
1
1
1
1
1
0
1
1
1
1
1
0
1
0
0
0
0
1
1
0
0
1
0
1
50
1
0
0
0
0
0
0
...

output:

? 1 25
? 2 25
? 3 25
? 4 25
? 5 25
? 6 25
? 7 25
? 8 25
? 9 25
? 10 25
? 11 25
? 12 25
? 13 25
? 14 25
? 15 25
? 16 25
? 17 25
? 18 25
? 19 25
? 20 25
? 21 25
? 22 25
? 23 25
? 24 25
? 25 25
? 26 25
? 27 25
? 28 25
? 29 25
? 30 25
? 31 25
? 32 25
? 33 25
? 34 25
? 35 25
? 36 25
? 37 25
? 38 25
? 39 ...

result:

ok max_C=2.96, avg_C=2.83 (100 test cases)

Test #9:

score: 0
Accepted
time: 37ms
memory: 40800kb

input:

10
500
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
0
1
0
1
0
1
0
1
0
1
1
0
1
1
1
1
1
1
1
0
1
1
1
0
1
0
1
0
1
0
1
1
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
0
0
1
0
1
0
1
0
1
0
1
0
0
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
0
0
1
0
1
0
1
0
1
0
0
0
1
0
0
0
0
0
1
0
1
0
1
0
1
0
0
0
0
0
1
0
1
0
0
0...

output:

? 1 250
? 2 250
? 3 250
? 4 250
? 5 250
? 6 250
? 7 250
? 8 250
? 9 250
? 10 250
? 11 250
? 12 250
? 13 250
? 14 250
? 15 250
? 16 250
? 17 250
? 18 250
? 19 250
? 20 250
? 21 250
? 22 250
? 23 250
? 24 250
? 25 250
? 26 250
? 27 250
? 28 250
? 29 250
? 30 250
? 31 250
? 32 250
? 33 250
? 34 250
? 3...

result:

ok max_C=2.98, avg_C=2.97 (10 test cases)

Test #10:

score: 0
Accepted
time: 16ms
memory: 47328kb

input:

10
597
1
1000
1
0
1
0
0
0
0
0
1
0
0
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
0
0
0
0
1
0
1
0
0
0
1
0
1
0
1
0
1
0
0
0
1
0
0
0
0
0
0
0
0
0
0
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
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
0
0
1
0
0
0
0
0
0
0
1
0
0
0
1
1
1
1
1
0
1
0
1
0
...

output:

! -1 -1
? 1 500
? 2 500
? 3 500
? 4 500
? 5 500
? 6 500
? 7 500
? 8 500
? 9 500
? 10 500
? 11 500
? 12 500
? 13 500
? 14 500
? 15 500
? 16 500
? 17 500
? 18 500
? 19 500
? 20 500
? 21 500
? 22 500
? 23 500
? 24 500
? 25 500
? 26 500
? 27 500
? 28 500
? 29 500
? 30 500
? 31 500
? 32 500
? 33 500
? 34...

result:

ok max_C=2.99, avg_C=1.76 (10 test cases)

Test #11:

score: 0
Accepted
time: 14ms
memory: 40736kb

input:

5
999
1
999
1
999
1
999
1
999
1

output:

! -1 -1
! -1 -1
! -1 -1
! -1 -1
! -1 -1

result:

ok max_C=0.00, avg_C=0.00 (5 test cases)

Test #12:

score: 0
Accepted
time: 43ms
memory: 46340kb

input:

5
1000
1
0
1
0
1
0
1
0
1
0
1
0
1
1
1
0
1
0
0
0
0
0
0
0
1
0
1
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
1
0
1
0
1
0
1
0
1
0
1
0
1
1
1
1
1
1
1
0
1
1
1
1
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
1
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
0
0
1
0
1
0
1
0
1
0
1
0
1...

output:

? 1 500
? 2 500
? 3 500
? 4 500
? 5 500
? 6 500
? 7 500
? 8 500
? 9 500
? 10 500
? 11 500
? 12 500
? 13 500
? 14 500
? 15 500
? 16 500
? 17 500
? 18 500
? 19 500
? 20 500
? 21 500
? 22 500
? 23 500
? 24 500
? 25 500
? 26 500
? 27 500
? 28 500
? 29 500
? 30 500
? 31 500
? 32 500
? 33 500
? 34 500
? 3...

result:

ok max_C=2.98, avg_C=2.98 (5 test cases)

Test #13:

score: 0
Accepted
time: 48ms
memory: 48340kb

input:

5
1000
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
0
0
1
0
1
0
1
0
1
1
1
1
1
0
1
0
1
0
1
0
0
0
0
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
0
0
0
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
0
1
0
1
0
0
0
0
0
0
0
1
0
0
0
1
0
1
0
1
0
1
0
0
0
1
0
1
0
1
0
1
0
1
0
0
0
1
0
1
0
1
0
0
0
1
0
1
0
1
0
1...

output:

? 1 500
? 2 500
? 3 500
? 4 500
? 5 500
? 6 500
? 7 500
? 8 500
? 9 500
? 10 500
? 11 500
? 12 500
? 13 500
? 14 500
? 15 500
? 16 500
? 17 500
? 18 500
? 19 500
? 20 500
? 21 500
? 22 500
? 23 500
? 24 500
? 25 500
? 26 500
? 27 500
? 28 500
? 29 500
? 30 500
? 31 500
? 32 500
? 33 500
? 34 500
? 3...

result:

ok max_C=2.98, avg_C=2.98 (5 test cases)

Test #14:

score: 0
Accepted
time: 47ms
memory: 47072kb

input:

5
1000
1
1
0
1
0
1
0
1
0
0
0
0
0
1
0
1
0
1
0
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
1
0...

output:

? 1 500
? 2 500
? 3 500
? 4 500
? 5 500
? 6 500
? 7 500
? 8 500
? 9 500
? 10 500
? 11 500
? 12 500
? 13 500
? 14 500
? 15 500
? 16 500
? 17 500
? 18 500
? 19 500
? 20 500
? 21 500
? 22 500
? 23 500
? 24 500
? 25 500
? 26 500
? 27 500
? 28 500
? 29 500
? 30 500
? 31 500
? 32 500
? 33 500
? 34 500
? 3...

result:

ok max_C=2.99, avg_C=2.98 (5 test cases)

Test #15:

score: 0
Accepted
time: 50ms
memory: 47804kb

input:

5
1000
1
0
1
0
0
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
0
0
1
0
1
0
1
0
0
0
1
0
1
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
1
0
0
0
0
0
1
0
1
0
0
0
1
0
0
0
1
0
1
0
1
0
0
0
1
0
1
0
1
0
0
0
1
0
1
0
1
0
1
0
0
0
0
0
1
0
0
0
1
0
1
0
1
0
0
0
1
0
1
0
1
0
0
0
1
0
1
0
1
0
1
0
0
0
1
0
1
0
0
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
0
0
0...

output:

? 1 500
? 2 500
? 3 500
? 4 500
? 5 500
? 6 500
? 7 500
? 8 500
? 9 500
? 10 500
? 11 500
? 12 500
? 13 500
? 14 500
? 15 500
? 16 500
? 17 500
? 18 500
? 19 500
? 20 500
? 21 500
? 22 500
? 23 500
? 24 500
? 25 500
? 26 500
? 27 500
? 28 500
? 29 500
? 30 500
? 31 500
? 32 500
? 33 500
? 34 500
? 3...

result:

ok max_C=2.99, avg_C=2.98 (5 test cases)

Test #16:

score: 0
Accepted
time: 32ms
memory: 47092kb

input:

5
1000
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
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
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
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1...

output:

? 1 500
? 2 500
? 3 500
? 4 500
? 5 500
? 6 500
? 7 500
? 8 500
? 9 500
? 10 500
? 11 500
? 12 500
? 13 500
? 14 500
? 15 500
? 16 500
? 17 500
? 18 500
? 19 500
? 20 500
? 21 500
? 22 500
? 23 500
? 24 500
? 25 500
? 26 500
? 27 500
? 28 500
? 29 500
? 30 500
? 31 500
? 32 500
? 33 500
? 34 500
? 3...

result:

ok max_C=2.99, avg_C=2.98 (5 test cases)

Test #17:

score: 0
Accepted
time: 48ms
memory: 47228kb

input:

5
1000
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0...

output:

? 1 500
? 2 500
? 3 500
? 4 500
? 5 500
? 6 500
? 7 500
? 8 500
? 9 500
? 10 500
? 11 500
? 12 500
? 13 500
? 14 500
? 15 500
? 16 500
? 17 500
? 18 500
? 19 500
? 20 500
? 21 500
? 22 500
? 23 500
? 24 500
? 25 500
? 26 500
? 27 500
? 28 500
? 29 500
? 30 500
? 31 500
? 32 500
? 33 500
? 34 500
? 3...

result:

ok max_C=2.98, avg_C=2.98 (5 test cases)

Test #18:

score: 0
Accepted
time: 40ms
memory: 50020kb

input:

5
1000
1
0
1
0
1
0
0
0
1
0
0
0
1
0
1
0
0
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
0
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
1
0
1
0
1
0
0
0
1
0
1
0
1
0
0
0
1
0
1
0
1
0
0
0
1
1
1
0
1
0
1
0
1
0
1
0
0
0
1
0
1
0
1
0
1
0
1
0
1
0
0
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
0
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0...

output:

? 1 500
? 2 500
? 3 500
? 4 500
? 5 500
? 6 500
? 7 500
? 8 500
? 9 500
? 10 500
? 11 500
? 12 500
? 13 500
? 14 500
? 15 500
? 16 500
? 17 500
? 18 500
? 19 500
? 20 500
? 21 500
? 22 500
? 23 500
? 24 500
? 25 500
? 26 500
? 27 500
? 28 500
? 29 500
? 30 500
? 31 500
? 32 500
? 33 500
? 34 500
? 3...

result:

ok max_C=2.99, avg_C=2.98 (5 test cases)

Test #19:

score: 0
Accepted
time: 55ms
memory: 49800kb

input:

5
1000
1
0
1
0
1
0
1
0
1
1
1
1
0
1
1
0
1
0
1
0
1
0
0
0
1
0
1
0
1
1
0
1
0
1
0
1
1
0
1
1
1
1
0
1
0
1
0
1
1
1
1
1
1
1
1
1
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
0
0
1
0
1
0
0
0
1
0
0
0
1
0
1
0
1
0
1
1
1
0
1
0
1
0
1
0
1
0
1
0
1
0
0
0
0
0
0
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
1
0
1
1
1
1
1
1
0
1
1
1
0
1...

output:

? 1 500
? 2 500
? 3 500
? 4 500
? 5 500
? 6 500
? 7 500
? 8 500
? 9 500
? 10 500
? 11 500
? 12 500
? 13 500
? 14 500
? 15 500
? 16 500
? 17 500
? 18 500
? 19 500
? 20 500
? 21 500
? 22 500
? 23 500
? 24 500
? 25 500
? 26 500
? 27 500
? 28 500
? 29 500
? 30 500
? 31 500
? 32 500
? 33 500
? 34 500
? 3...

result:

ok max_C=2.99, avg_C=2.98 (5 test cases)

Test #20:

score: 0
Accepted
time: 42ms
memory: 47276kb

input:

5
1000
1
0
1
0
1
1
1
1
1
1
1
0
1
0
0
0
1
1
1
0
0
0
1
0
1
1
1
0
1
0
1
1
1
1
1
1
0
1
1
1
0
1
0
1
0
1
1
1
1
0
1
0
1
1
1
1
0
1
1
1
1
1
1
1
1
0
1
0
1
0
1
0
1
0
1
1
1
0
1
0
1
0
1
0
1
1
1
0
1
1
1
1
1
0
1
0
1
1
1
0
1
0
1
0
1
0
1
0
1
0
1
1
1
0
1
0
1
0
1
0
1
0
1
1
1
0
1
0
1
1
0
1
1
1
1
0
1
0
1
0
1
0
1
1
1
0
1...

output:

? 1 500
? 2 500
? 3 500
? 4 500
? 5 500
? 6 500
? 7 500
? 8 500
? 9 500
? 10 500
? 11 500
? 12 500
? 13 500
? 14 500
? 15 500
? 16 500
? 17 500
? 18 500
? 19 500
? 20 500
? 21 500
? 22 500
? 23 500
? 24 500
? 25 500
? 26 500
? 27 500
? 28 500
? 29 500
? 30 500
? 31 500
? 32 500
? 33 500
? 34 500
? 3...

result:

ok max_C=2.99, avg_C=2.98 (5 test cases)