QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#566416#94. Good Old Table3un_larryfuncAC ✓48ms6288kbC++984.6kb2024-09-16 00:04:312024-09-16 00:04:32

詳細信息

Test #1:

score: 100
Accepted
time: 30ms
memory: 5980kb

input:

3000 3000
2 1 2 1 2 1 1 1 1 2 1 1 2 2 1 2 2 2 2 1 1 1 2 1 1 2 2 2 2 2 2 1 1 1 1 2 1 2 1 2 1 2 2 2 2 1 1 2 2 1 1 1 1 2 1 2 1 2 1 2 1 1 1 2 1 1 2 1 2 2 1 1 1 2 2 2 2 1 1 2 2 2 2 2 2 2 1 2 1 1 1 2 2 1 1 1 1 1 2 2 2 2 1 2 2 1 2 1 1 2 2 2 1 1 1 2 1 1 2 1 2 2 2 1 2 2 1 1 2 1 2 2 1 1 1 1 2 1 2 2 1 1 2 2 2 ...

output:

4499318

result:

ok 1 number(s): "4499318"

Test #2:

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

input:

3000 3000
1 2 2 2 1 2 2 1 1 1 2 1 2 1 2 2 2 1 2 1 1 2 2 2 2 2 1 2 2 2 2 2 2 1 2 1 2 2 2 1 1 2 2 1 2 2 1 2 2 2 1 2 1 1 1 2 2 1 2 1 2 1 2 2 1 2 2 1 1 2 2 1 2 2 2 2 2 1 1 2 2 2 1 1 1 1 2 2 1 1 2 1 1 2 1 1 1 1 2 2 2 2 2 2 1 1 2 2 1 1 1 1 2 1 2 2 2 1 2 2 1 2 1 1 1 1 1 2 1 2 2 1 1 2 2 1 2 2 1 1 2 2 2 1 2 ...

output:

4500268

result:

ok 1 number(s): "4500268"

Test #3:

score: 0
Accepted
time: 45ms
memory: 6020kb

input:

3000 3000
1 1 2 2 2 2 1 2 1 1 2 1 2 2 2 2 1 2 1 1 1 1 1 2 2 1 2 2 2 2 2 1 1 2 2 2 2 2 1 2 1 2 1 1 2 2 2 1 2 2 2 1 2 1 1 2 2 2 1 2 2 1 2 2 2 1 2 2 2 2 1 1 1 1 1 2 1 2 1 1 2 2 2 2 2 2 2 1 2 1 2 1 1 2 1 2 1 1 1 2 2 2 1 2 1 1 2 1 1 2 1 1 1 2 2 1 2 2 2 2 2 2 2 1 2 2 2 1 1 1 1 1 2 2 2 2 2 2 1 1 2 2 2 2 2 ...

output:

4499488

result:

ok 1 number(s): "4499488"

Test #4:

score: 0
Accepted
time: 4ms
memory: 4864kb

input:

3000 3000
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 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 ...

output:

0

result:

ok 1 number(s): "0"

Test #5:

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

input:

3000 3000
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 ...

output:

9000000

result:

ok 1 number(s): "9000000"

Test #6:

score: 0
Accepted
time: 9ms
memory: 4352kb

input:

712 2467
2 1 2 2 2 2 2 2 2 1 1 1 1 2 1 2 2 2 1 1 2 2 1 1 2 1 2 2 1 2 1 2 2 1 1 2 2 2 1 1 1 2 2 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 1 1 1 1 2 2 2 1 1 1 1 1 2 1 2 2 2 2 1 1 2 2 1 1 1 1 2 1 1 1 1 2 1 1 1 2 2 2 2 2 2 1 2 1 1 1 1 1 2 2 2 1 2 2 2 2 1 1 1 1 1 2 2 2 2 1 1 1 1 2 2 1 1 2 1 2 1 1 1 1 1 2 2 2 2 2...

output:

299224

result:

ok 1 number(s): "299224"

Test #7:

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

input:

842 643
1 1 2 1 2 1 2 1 2 1 2 2 1 1 2 2 2 2 2 1 1 1 2 1 1 1 2 1 2 2 1 2 1 1 1 1 1 2 2 1 1 1 1 1 2 1 2 1 2 2 2 1 1 2 2 1 2 1 2 1 1 1 2 1 2 2 2 1 1 1 1 2 2 1 1 2 2 2 2 2 1 2 1 2 1 1 1 1 1 2 1 2 1 1 1 2 2 2 1 1 1 1 1 1 2 2 1 2 2 2 2 1 1 2 1 2 1 1 1 2 1 2 1 1 2 1 1 1 2 2 2 2 1 1 1 2 1 1 1 2 2 1 1 1 2 1 ...

output:

184027

result:

ok 1 number(s): "184027"

Test #8:

score: 0
Accepted
time: 6ms
memory: 5900kb

input:

463 1850
2 1 1 2 2 1 2 1 1 1 1 1 1 1 2 1 1 2 2 2 2 2 1 2 2 2 2 2 1 2 2 2 2 1 2 1 2 1 1 1 1 2 1 2 2 2 1 1 2 1 2 2 1 2 1 1 2 1 2 2 1 2 1 2 1 1 2 2 1 2 2 1 1 2 1 2 2 1 1 2 2 1 2 1 1 2 2 2 2 2 2 2 1 2 1 2 1 1 2 1 2 1 2 1 2 2 2 1 2 1 1 2 2 2 1 2 2 2 1 2 2 1 1 2 1 1 2 1 1 1 2 2 1 1 1 1 2 1 2 1 2 1 2 1 1 1...

output:

411193

result:

ok 1 number(s): "411193"

Test #9:

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

input:

287 820
1 2 1 2 1 1 1 2 2 1 2 2 1 2 2 2 2 1 1 2 2 2 2 1 1 2 1 1 1 1 1 1 2 1 1 2 1 2 1 1 1 1 2 1 1 2 2 2 2 2 2 1 1 1 2 1 2 2 2 2 2 1 1 2 2 1 1 1 1 2 2 1 1 2 2 1 1 2 1 1 2 2 1 2 1 2 1 1 1 1 2 2 1 2 1 1 1 1 2 1 2 1 1 2 1 1 2 2 1 2 1 1 1 1 2 2 2 1 1 1 2 2 1 1 2 2 1 2 1 2 2 1 2 1 2 1 2 2 2 2 2 1 1 2 2 1 ...

output:

75191

result:

ok 1 number(s): "75191"

Test #10:

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

input:

109 160
2 2 1 2 1 1 2 2 1 1 1 1 2 2 2 2 1 2 1 1 2 2 2 1 1 1 1 2 2 1 1 2 1 1 2 1 2 2 2 1 2 2 1 2 2 2 2 2 2 1 1 2 1 1 1 1 2 1 1 2 1 1 1 2 1 2 1 1 2 2 2 2 2 1 2 2 1 2 1 1 2 2 2 2 1 2 1 2 1 1 2 1 2 1 1 2 1 2 2 2 1 1 2 1 1 1 1 2 1 2 1 1 1 2 1 2 1 2 1 2 2 1 2 2 1 2 2 1 2 2 1 2 1 2 2 1 2 1 1 2 1 2 1 2 2 1 ...

output:

2630

result:

ok 1 number(s): "2630"

Test #11:

score: 0
Accepted
time: 3ms
memory: 4160kb

input:

565 558
2 1 1 2 2 1 2 2 2 2 2 1 2 2 2 2 1 1 2 1 1 1 1 1 2 2 1 2 1 1 2 1 1 1 2 2 2 2 1 1 2 1 1 1 1 1 2 2 2 2 2 2 1 1 1 2 1 1 2 1 1 1 2 1 1 1 1 1 1 2 2 2 1 2 1 1 1 1 1 2 1 2 2 2 1 1 2 2 2 1 2 1 2 1 2 2 2 1 1 1 1 1 2 2 1 1 1 2 1 2 1 1 1 2 1 2 2 2 2 2 1 2 1 1 2 1 2 2 1 1 2 2 1 2 1 1 1 1 1 2 2 1 2 1 2 1 ...

output:

-1

result:

ok 1 number(s): "-1"

Test #12:

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

input:

1918 1
1
1
1
2
2
1
2
2
2
2
1
1
1
1
1
1
1
1
1
1
2
2
2
1
2
1
2
2
1
2
2
1
1
2
2
2
1
1
2
2
1
2
1
2
1
2
1
2
1
1
1
2
1
2
2
2
1
2
2
2
1
2
1
1
1
1
1
1
2
1
1
2
2
1
1
1
2
1
2
2
1
2
2
1
1
2
2
2
1
2
1
1
2
1
2
1
2
2
2
2
2
1
1
1
1
2
1
2
1
1
1
1
1
2
2
1
1
2
2
2
2
2
1
2
1
1
1
1
2
1
2
1
1
1
2
1
2
2
1
1
1
2
1
2
1
1
2...

output:

-1

result:

ok 1 number(s): "-1"

Test #13:

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

input:

1806 2
2 2
1 2
2 1
2 1
2 2
2 1
2 1
2 1
2 2
2 1
1 1
2 1
2 1
1 1
1 1
1 1
1 1
1 1
2 2
1 2
1 2
1 2
1 2
1 2
1 1
1 2
2 1
2 1
1 1
1 2
2 2
2 2
2 2
2 2
1 1
2 2
2 1
2 2
2 1
2 1
1 1
1 2
1 2
1 1
2 2
2 2
2 2
2 1
2 2
1 2
2 2
1 1
2 2
2 2
1 2
1 2
1 1
2 1
2 1
1 1
1 1
2 1
2 1
2 2
1 1
2 1
1 2
2 2
2 2
1 1
1 1
1 1
1 2
2...

output:

1758

result:

ok 1 number(s): "1758"

Test #14:

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

input:

1544 3
1 2 2
1 1 1
2 1 1
1 2 2
2 1 1
1 2 1
2 1 1
1 2 1
2 2 1
1 2 2
1 2 2
1 2 2
1 1 2
1 2 1
2 1 2
1 2 2
1 1 2
2 1 1
2 1 1
1 2 1
1 1 1
2 2 1
2 1 1
1 2 1
1 1 1
1 1 1
1 1 2
2 1 1
2 2 2
2 2 1
1 1 1
2 1 2
1 1 2
2 2 1
1 1 1
2 1 2
1 2 2
1 1 2
1 2 1
1 2 2
2 2 1
1 1 1
1 2 2
1 2 1
1 2 1
1 1 2
1 1 2
2 2 2
1 2 1...

output:

-1

result:

ok 1 number(s): "-1"

Test #15:

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

input:

3 2
2 1
2 1
1 1

output:

2

result:

ok 1 number(s): "2"

Test #16:

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

input:

4 1
2
2
2
2

output:

1

result:

ok 1 number(s): "1"

Test #17:

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

input:

3 2
1 2
1 2
1 1

output:

2

result:

ok 1 number(s): "2"

Test #18:

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

input:

1 2
1 1

output:

0

result:

ok 1 number(s): "0"

Test #19:

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

input:

3 2
1 2
1 2
1 1

output:

2

result:

ok 1 number(s): "2"

Test #20:

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

input:

3000 3000
1 1 1 1 1 1 2 1 2 1 1 2 1 2 1 1 2 2 2 1 2 1 1 2 1 1 2 1 1 2 1 1 1 2 2 1 1 1 1 2 1 2 2 2 2 1 1 2 2 2 1 2 2 2 1 1 2 1 1 2 2 2 2 1 2 1 1 1 1 2 2 2 2 1 2 2 1 1 1 2 2 2 1 2 2 1 1 1 1 2 1 2 1 2 2 2 1 1 1 1 1 2 2 1 2 2 1 1 1 1 1 1 1 2 2 1 1 2 1 1 1 2 2 2 2 1 2 2 1 1 1 1 1 2 1 2 2 1 2 1 2 2 2 2 1 ...

output:

4499996

result:

ok 1 number(s): "4499996"

Test #21:

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

input:

2999 3000
1 2 1 1 2 1 2 1 2 1 2 1 1 2 1 2 1 1 1 1 2 1 2 1 1 1 1 2 2 1 2 1 1 1 1 1 2 2 1 2 1 2 1 2 2 2 2 2 2 1 2 2 2 1 2 1 1 2 2 2 2 1 1 2 2 2 2 2 1 2 1 2 2 1 2 2 1 2 1 1 1 2 2 1 2 1 2 1 2 1 1 2 1 1 2 2 2 1 1 2 2 1 2 1 1 2 1 1 2 1 2 1 2 2 1 1 1 1 2 2 2 2 2 1 1 1 1 2 2 1 1 2 1 2 1 2 2 1 2 1 1 1 1 2 2 ...

output:

4423060

result:

ok 1 number(s): "4423060"

Test #22:

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

input:

3000 2999
2 2 2 1 2 1 1 2 2 1 1 2 1 1 2 1 1 2 2 1 2 1 2 1 2 1 2 1 1 2 2 1 1 2 2 1 2 2 2 1 2 2 2 2 1 1 2 1 2 2 2 1 2 2 2 2 2 2 2 2 2 1 1 2 2 1 1 1 1 1 2 2 2 2 1 2 1 2 2 1 1 1 2 2 2 2 1 2 1 2 1 1 2 2 1 2 1 2 2 1 1 1 1 2 2 2 2 2 1 1 2 1 2 2 1 2 2 2 1 2 2 1 1 1 1 2 1 2 2 2 1 1 2 2 2 2 2 1 1 2 1 1 2 2 1 ...

output:

4434271

result:

ok 1 number(s): "4434271"