QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#637109#8085. BulbasaurqiuzxAC ✓998ms3924kbC++201.7kb2024-10-13 09:42:502024-10-13 09:42:50

详细

Test #1:

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

input:

4 4
1000
1100
0110
0011

0100
1100
0010
0001

1000
1100
0000
0011

output:

21

result:

ok 1 number(s): "21"

Test #2:

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

input:

5 3
000
100
010

000
100
010

010
101
010

010
101
010

output:

17

result:

ok 1 number(s): "17"

Test #3:

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

input:

3 3
001
011
001

001
001
110

output:

6

result:

ok 1 number(s): "6"

Test #4:

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

input:

20 5
11010
01101
11110
01011
00011

00000
01001
00101
10001
11100

01101
00001
11101
11110
11000

00111
10001
11110
11101
10000

00100
10111
11101
00011
01110

11011
10101
01100
00100
01111

01000
10101
11110
10111
10110

00100
11110
10011
01100
11101

10111
00100
01001
00111
11111

00010
00100
1111...

output:

760

result:

ok 1 number(s): "760"

Test #5:

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

input:

2 9
011110001
001110111
011010011
110111001
000011111
010000100
110100011
001101100
011010001

output:

9

result:

ok 1 number(s): "9"

Test #6:

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

input:

70 7
1010010
0010011
0110001
1011110
1001001
0000010
0111111

0110000
0000100
0001000
0000010
1111011
0100010
0001010

1101001
1001100
1011101
1011011
0010011
1001011
1100101

0011000
0100000
0010101
1010000
1011000
0100101
1111001

1010010
1100010
1101101
0011000
1111001
1111000
0001100

0110110
00...

output:

14020

result:

ok 1 number(s): "14020"

Test #7:

score: 0
Accepted
time: 5ms
memory: 3924kb

input:

400 8
01000111
00111000
11010001
00000100
10011101
00011101
10001100
11011110

00001100
10100011
00000101
10000111
00010010
10011111
01011000
00101100

00000111
01111001
01111010
01101001
00101001
10110001
00000100
11110101

01001011
11100000
00110110
10110001
10101100
01100001
10000001
00101101

11...

output:

562524

result:

ok 1 number(s): "562524"

Test #8:

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

input:

3000 9
011001101
101000001
110011100
000001010
110010101
111110001
000110100
000100010
010010011

001111011
011110011
011011010
111010111
000000101
101110101
111010010
110010011
001011111

000101010
101101110
001100110
000001100
110110101
101000110
010110011
101011101
111111101

111111101
110010011
...

output:

32583329

result:

ok 1 number(s): "32583329"

Test #9:

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

input:

70 7
0101000
0000011
1000000
1010110
0001110
0000000
0000101

0100010
0000010
0001001
1000010
0001000
0011001
1010010

0000001
1000010
0000000
0001100
1010000
0001001
0101000

0001011
0000010
1100000
0001000
0001000
0000000
0000100

0000001
1100000
0000101
1000101
0001000
1011001
1100100

1000010
01...

output:

5277

result:

ok 1 number(s): "5277"

Test #10:

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

input:

400 8
00000010
10000001
01000001
00000110
00000000
00010000
00010111
10101110

00000110
01100010
01000000
00100101
00011001
00000001
00000000
11001001

00010000
10100000
00000001
00000000
00010100
00000100
01000000
00101000

00010011
00001000
00000000
00001010
11010100
00000010
00010010
11100100

00...

output:

211372

result:

ok 1 number(s): "211372"

Test #11:

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

input:

3000 9
100000010
100000010
100000100
100000110
001001010
000000011
000101101
001000000
000000000

001000010
001001011
011001110
100000100
001001010
011000010
110001000
000000111
000000000

010010000
000000000
101100000
010000000
100000000
000011000
000000000
000110100
000000000

010000000
100100000
...

output:

11288321

result:

ok 1 number(s): "11288321"

Test #12:

score: 0
Accepted
time: 23ms
memory: 3660kb

input:

39996 1
1

1

1

1

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

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:

4331603

result:

ok 1 number(s): "4331603"

Test #13:

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

input:

40000 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

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:

415

result:

ok 1 number(s): "415"

Test #14:

score: 0
Accepted
time: 955ms
memory: 3668kb

input:

39998 9
111100111
110111111
111111111
111100110
010111001
111111111
111011111
111111111
100111111

110111111
001011100
111101101
011100111
111100111
111111111
101111111
110110100
011111111

010111111
111100111
111111100
101010111
111111110
001111101
111111111
111011111
111111001

111110101
111101111...

output:

6857524907

result:

ok 1 number(s): "6857524907"

Test #15:

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

input:

40000 9
010111101
010110110
110011110
011110111
111011111
110111101
111011111
011101011
010101101

111001011
011010111
111101011
110111100
111111111
110001110
111110101
111110100
110111010

001010111
011011111
000111110
010111111
111111111
111011110
110111111
011011111
011100111

110001111
111110011...

output:

6506354624

result:

ok 1 number(s): "6506354624"

Test #16:

score: 0
Accepted
time: 960ms
memory: 3852kb

input:

39996 9
110111110
101000110
110111101
111111000
111111110
110111011
100010111
011000100
001110110

110010010
110011111
111110100
010101101
101101011
111001111
010111111
111011011
011011010

111011101
110011111
010101110
011101011
001011101
111110000
011111001
011010111
100001011

011011101
110001100...

output:

6433572516

result:

ok 1 number(s): "6433572516"

Test #17:

score: 0
Accepted
time: 960ms
memory: 3848kb

input:

39997 9
110000010
110010100
111011001
000110010
001100111
000110011
000110100
110001001
111000111

000110011
011111000
011010100
000110011
100110011
010010111
101111001
111000000
000001110

111111101
100110010
000011010
000011110
011111011
101010011
110110011
001001110
101010110

110000100
011111001...

output:

5636554792

result:

ok 1 number(s): "5636554792"

Test #18:

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

input:

39996 9
000100000
100000100
011001000
100000010
100000000
110000000
100000000
000100110
100100010

110100000
001110011
010011011
001011001
000010011
010100000
001000000
001110001
010111010

110110001
001110010
100011000
011100100
000110110
000000010
000101011
010100000
010101100

100010000
101010110...

output:

2791426683

result:

ok 1 number(s): "2791426683"

Test #19:

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

input:

39999 9
000100000
000010000
000000001
000000000
011010000
100010110
000100000
000111000
100000100

000110000
001100000
011000001
000000000
010000011
000000000
100100000
000000010
000101001

000000010
001000010
000000100
011000100
000001010
000001100
000001100
000000000
010100000

000000000
000010000...

output:

1161250401

result:

ok 1 number(s): "1161250401"

Test #20:

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

input:

39998 9
000010000
000000100
000000010
010001000
110000001
110110000
000000000
000000000
001000000

000000010
011000000
011000000
000000100
100000010
100011011
100001100
000000000
010000001

100000000
001000000
000000011
010010010
000000000
000000000
000000000
000100000
000000000

010000000
100010100...

output:

163865771

result:

ok 1 number(s): "163865771"

Test #21:

score: 0
Accepted
time: 956ms
memory: 3720kb

input:

39997 9
100000000
001100010
000000000
001001100
000000000
000000001
011001010
000000010
000000001

000000100
001100000
100000000
000000001
000001001
011000010
000100000
000011000
000010100

000001001
000000000
110000000
100100011
001100011
000010000
011001000
000000000
100010100

000000010
100100001...

output:

9870164

result:

ok 1 number(s): "9870164"

Test #22:

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

input:

39996 9
000010000
000001011
001100000
001100010
010000000
000000100
000000000
001000000
000100000

100100000
000001000
010000110
000000000
000000000
000000110
001000000
010000000
000000000

000000000
001000001
000101000
000000000
001000000
100000000
001001001
000001100
000100000

100001000
000001000...

output:

2514820

result:

ok 1 number(s): "2514820"

Test #23:

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

input:

39999 9
010000000
010000000
010010000
000000000
000000001
000000000
001000011
000000100
000000010

000000000
001000000
000000000
000000110
000000000
000000011
000000000
000010000
000010000

000010100
000000000
000000000
000100000
010000000
000000100
000000100
100100000
001000000

000000000
000010000...

output:

1233404

result:

ok 1 number(s): "1233404"

Test #24:

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

input:

39999 9
010000000
010001100
000000000
001000000
000000000
001000010
001000000
000000000
001000100

000100000
100001000
000000000
000000000
000000000
010000000
100000000
001000100
001000000

000000000
000000000
100000000
000000011
000100000
000000110
000000000
100000000
000000000

000001000
000000000...

output:

831506

result:

ok 1 number(s): "831506"

Test #25:

score: 0
Accepted
time: 51ms
memory: 3924kb

input:

40000 4
0101
0101
0101
0010

1110
0111
1011
0101

1111
1111
1111
0111

0011
1011
1111
0110

1001
0101
1111
1011

0111
1101
1111
1111

1111
1011
1011
1111

1011
0110
1111
0111

1111
0111
1111
1110

0111
1101
1011
1101

0111
1101
1111
0100

1111
0111
1111
1111

0111
1000
1101
1101

0011
1111
1011
0001...

output:

1696211735

result:

ok 1 number(s): "1696211735"

Test #26:

score: 0
Accepted
time: 52ms
memory: 3724kb

input:

39996 4
0011
0110
1111
1010

1111
1101
1101
0111

0010
0110
1111
1011

1011
1101
0111
0110

1011
1111
0011
1110

1001
1110
1110
0100

0011
0110
1011
1011

1010
1111
0001
1011

1111
0011
1111
1010

1010
1110
1010
1111

0101
0011
1011
0000

1111
0100
0101
0011

1101
1100
1111
0001

1001
0110
1101
1101...

output:

1067460290

result:

ok 1 number(s): "1067460290"

Test #27:

score: 0
Accepted
time: 53ms
memory: 3852kb

input:

39997 4
0101
1111
1000
0111

0010
0100
1010
0001

1010
0010
1100
0011

0101
0011
1010
0111

0001
0111
0100
0101

0100
1101
1000
0110

0000
0011
1001
1011

1111
0100
1101
1010

0000
0100
0100
1000

0111
1010
1010
0011

0000
0110
0111
0011

1111
0010
0011
1000

0000
0101
0110
1010

1001
0010
1110
0001...

output:

26100433

result:

ok 1 number(s): "26100433"

Test #28:

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

input:

39996 4
0010
1111
1110
0000

0001
0000
0000
1000

1101
0100
1000
0000

0001
0111
0000
0100

0011
0010
0011
0100

0010
1000
0001
0011

0000
0101
0000
0001

0100
1000
1100
1010

0111
0010
0000
0010

0000
0000
1000
0101

0000
0100
0110
1001

0001
0010
0010
0001

0001
1100
0001
0010

1001
1111
1001
0010...

output:

1261802

result:

ok 1 number(s): "1261802"

Test #29:

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

input:

39999 4
1100
0010
0101
0100

0011
0000
0010
0010

0000
0100
0000
0111

1001
0000
1000
0010

0000
0000
1001
1000

1000
0110
0001
0010

0000
0010
0000
0000

0001
0010
0010
0000

0010
0000
1000
0010

0000
0110
0100
0000

0000
0011
0001
0000

0001
0010
0110
0010

0000
0101
1000
0000

1001
1000
0000
1000...

output:

403501

result:

ok 1 number(s): "403501"

Test #30:

score: 0
Accepted
time: 996ms
memory: 3916kb

input:

39997 9
000000001
000001000
000100000
000100000
001000000
000000100
010000000
001000000
001000000

010000000
000001000
000100000
000000001
001000000
000010000
000100000
000000010
000000100

000000100
010000000
100000000
001000000
000000100
001000000
000000001
000010000
000000010

000000100
000100000...

output:

800913365

result:

ok 1 number(s): "800913365"

Test #31:

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

input:

39997 9
010000000
001000000
100000000
000100000
010000000
000000100
000100000
000100010
100000010

000000000
000000001
000000000
010100000
000000000
000000000
010000001
000000000
001000010

000000000
000100000
000000011
100100000
000000000
000000000
100000010
000000000
000000000

000100001
000000101...

output:

903807

result:

ok 1 number(s): "903807"

Test #32:

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

input:

39996 9
001000000
010010000
100010000
001000000
000010000
000001000
100001000
010000000
001000000

000010100
010000000
000001000
001000001
100000010
000000010
010000000
000000001
001000100

000001000
000000101
001010000
010001000
000110000
100100000
000001000
000100001
000001000

100000010
000000011...

output:

920417013

result:

ok 1 number(s): "920417013"

Test #33:

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

input:

39996 9
000110010
100000000
000000000
000000000
000000010
000000000
000100010
000000000
000000101

010000010
000000001
000010000
001000000
100000000
011000000
000000000
000000000
100000010

000011000
000101100
000000000
000100001
000000000
100000010
000000000
000000100
001010000

000010000
000010000...

output:

6963695

result:

ok 1 number(s): "6963695"

Test #34:

score: 0
Accepted
time: 998ms
memory: 3516kb

input:

40000 9
011000010
100101000
100010000
010100000
000000001
000000100
000100000
110000001
100001010

000100001
000001001
000011001
001010000
001000101
100000010
010010000
010000100
001100001

010000000
100000001
101100000
000001011
000010000
010000100
010000000
010000001
000011010

010010100
100000100...

output:

2174710573

result:

ok 1 number(s): "2174710573"

Test #35:

score: 0
Accepted
time: 951ms
memory: 3576kb

input:

40000 9
010100101
110001100
110000000
100000010
000000000
011100000
101000011
000000000
000000000

100111000
000100000
001000011
001000100
000110000
001000000
000000000
000101001
100000100

010111000
110000000
000000000
000000000
000000000
001011000
100000000
101000000
000000000

010011010
000000001...

output:

227360370

result:

ok 1 number(s): "227360370"

Test #36:

score: 0
Accepted
time: 956ms
memory: 3728kb

input:

39999 9
100010000
101010010
001000000
011000101
101001001
100000110
000011001
010010100
000001100

000010000
100000000
000010000
100000010
001010101
001000001
100000000
000000001
101100100

000100001
000001100
010001000
000100000
100111000
011000001
001000000
001000000
100000000

011000000
000110000...

output:

2848744647

result:

ok 1 number(s): "2848744647"

Test #37:

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

input:

39998 9
010000000
000101000
000001000
000001000
110010011
000001001
000000000
101101000
000001000

101101100
000001000
000000100
000000000
000001001
010100111
100010000
000011111
010001111

010010100
000001000
000000000
110101000
010000000
001100001
000111000
010000000
000000000

100010000
000100000...

output:

896318448

result:

ok 1 number(s): "896318448"

Test #38:

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

input:

39998 9
011000111
000000100
000001000
011001000
000011001
010100110
000100001
101000000
100010010

111100001
000000100
101010011
110001101
110100011
001110010
101101100
110111000
101011010

001000101
011001101
000010001
100110110
011000000
011101000
100110011
000100000
001010100

000100010
100011000...

output:

3661818854

result:

ok 1 number(s): "3661818854"

Test #39:

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

input:

39998 9
111010100
001000011
000000000
000011100
000000010
000000001
000000000
000111101
000000100

111111111
000001001
000000000
001100000
111111101
000100100
110111101
111010011
110111111

111111111
000000000
000000101
111111100
001001111
100111100
000000000
100010101
110010101

111111111
110111101...

output:

2371060533

result:

ok 1 number(s): "2371060533"

Test #40:

score: 0
Accepted
time: 956ms
memory: 3844kb

input:

39998 9
101101000
111111111
110100001
101111111
010110100
000111111
111011111
101111011
000011000

111101111
101111111
010100100
101110111
001110011
001000000
000000101
111111111
000100000

110111110
111110011
110101100
000001000
000001000
110011101
110111101
111011111
001010000

111001001
111000101...

output:

4956588348

result:

ok 1 number(s): "4956588348"

Test #41:

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

input:

39998 9
001111101
111100010
011111111
101011010
101111010
001111110
111000101
001001011
111111110

000100001
011111111
111101101
101100001
101101111
010110000
111100111
111111001
001100111

000110101
111001111
000010001
010100001
111011011
111110110
111111111
111111111
000000011

100000001
011111000...

output:

5973026912

result:

ok 1 number(s): "5973026912"

Test #42:

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

input:

39998 9
110111111
111011111
111111111
010101011
101010001
010100100
000011010
010011111
101110010

111110111
101111000
100000111
001010101
100101011
100111111
010001001
111111111
001011011

111110111
101001000
010101011
000111010
000010101
110011110
010011100
101111100
101001010

010001101
100111000...

output:

6465978515

result:

ok 1 number(s): "6465978515"

Test #43:

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

input:

39996 9
001110111
100111011
111101011
110010111
000111110
110111011
011111110
111111111
111111111

010010011
101010110
011010111
111111111
111111111
111111001
111010011
111011111
111101010

101101001
111101111
011010110
010011010
001001011
101110110
101110111
101111011
111001011

111111111
101011000...

output:

6607941096

result:

ok 1 number(s): "6607941096"

Test #44:

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

input:

39996 9
111111111
111111111
101111111
111111111
101101011
111011001
111111111
111111100
010011011

101110001
111101111
111110011
111111011
101111111
111111111
110111000
110100110
101011111

111011000
101111111
011101111
101101001
101101111
111111111
101111100
110011011
111111000

100101011
111011111...

output:

7198380090

result:

ok 1 number(s): "7198380090"

Test #45:

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

input:

39996 9
111111111
101110111
111111111
011111011
111101111
111101111
111111101
111110001
101011110

111111111
111011101
111111111
111101101
011111111
110111111
111110111
110111010
101011011

110100111
111111111
111111110
001101111
011111111
111111111
111111111
111110111
111111111

111001111
111110110...

output:

7198380090

result:

ok 1 number(s): "7198380090"

Test #46:

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

input:

40000 9
111101111
111101111
111011011
111111111
110111111
111111111
111111111
111101110
011011111

111111101
111011111
111111111
101111111
111111111
111011110
111110111
111011111
111111111

011111111
101101111
111110110
111111111
111111111
111101111
111111111
111111111
111111111

110101111
111111111...

output:

7199820000

result:

ok 1 number(s): "7199820000"

Test #47:

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

input:

39999 9
111111111
111111111
111111110
111111111
011111111
111111111
111111111
111110111
111111111

101111111
110111111
111111011
111111111
111111111
111011111
111111111
111111111
111111111

111110111
011111111
111111111
111111011
111111111
111111111
111111111
011111111
111111111

110111111
111111111...

output:

7199460009

result:

ok 1 number(s): "7199460009"

Test #48:

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

input:

39999 9
111111111
111111111
111111111
111111111
111111111
111111111
111111111
111111111
111111111

111111111
111111111
111111111
111111111
111111111
111111111
111111111
111111111
111111111

111111111
111111111
111111111
111111111
111111111
111111111
111111111
111111111
111111111

111111111
111111111...

output:

7199460009

result:

ok 1 number(s): "7199460009"

Test #49:

score: 0
Accepted
time: 28ms
memory: 3616kb

input:

40000 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:

7154231

result:

ok 1 number(s): "7154231"

Test #50:

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

input:

39996 2
10
01

10
11

01
01

01
11

10
01

01
10

11
11

01
10

10
11

01
01

01
01

10
01

11
01

10
01

11
11

11
01

01
11

11
01

11
11

01
10

10
11

11
01

10
11

10
11

01
01

10
11

11
11

11
10

11
01

01
11

10
11

11
10

10
01

11
11

10
10

11
11

01
01

01
01

11
11

11
10

01
10

01
10...

output:

799960226

result:

ok 1 number(s): "799960226"

Test #51:

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

input:

40000 3
010
011
001

100
011
101

010
001
101

110
010
001

010
010
001

010
001
100

110
010
101

100
001
001

100
011
100

110
001
001

010
010
001

010
011
100

010
011
001

010
011
100

010
010
101

010
001
100

010
010
100

010
011
101

010
001
101

100
011
100

100
010
100

010
010
001

100
00...

output:

800842716

result:

ok 1 number(s): "800842716"

Test #52:

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

input:

39999 5
11000
01000
00110
00010
10001

10000
01000
00110
00010
10001

01000
01100
00010
00011
10000

10000
01000
00110
00001
00001

01000
01100
00110
00001
00001

01000
01000
00010
00011
10000

01000
01000
00110
00011
00001

10000
01000
00100
00010
00001

10000
01000
00010
00011
10000

10000
01100
0...

output:

810995271

result:

ok 1 number(s): "810995271"

Test #53:

score: 0
Accepted
time: 211ms
memory: 3912kb

input:

39998 7
1000000
0100000
0011000
0001100
0000100
0000011
1000001

1000000
0100000
0001000
0000100
0000100
0000010
1000001

0100000
0100000
0010000
0001000
0000110
0000001
1000000

1000000
0100000
0011000
0001000
0000100
0000011
1000000

1100000
0100000
0001000
0000100
0000010
0000010
1000001

1000000...

output:

918159210

result:

ok 1 number(s): "918159210"

Test #54:

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

input:

39996 9
100000000
011000000
001000000
000100000
000011000
000000100
000000100
000000001
000000001

010000000
011000000
001000000
000010000
000011000
000000100
000000100
000000011
100000000

010000000
001000000
001000000
000110000
000010000
000001000
000000010
000000011
100000001

110000000
011000000...

output:

1469267414

result:

ok 1 number(s): "1469267414"

Test #55:

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

input:

40000 3
100
010
001

100
010
001

100
010
001

100
010
001

100
010
001

100
010
001

100
010
001

100
010
001

100
010
001

100
010
001

100
010
001

100
010
001

100
010
001

100
010
001

100
010
001

100
010
001

100
010
001

100
010
001

100
010
001

100
010
001

100
010
001

100
010
001

100
01...

output:

24492431

result:

ok 1 number(s): "24492431"

Test #56:

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

input:

39998 5
10000
01000
00100
00010
00001

10000
01000
00100
00010
00001

10000
01000
00100
00010
00001

10000
01000
00100
00010
00001

10000
01000
00100
00010
00001

10000
01000
00100
00010
00001

10000
01000
00100
00010
00001

10000
01000
00100
00010
00001

10000
01000
00100
00010
00001

00000
01000
0...

output:

36202457

result:

ok 1 number(s): "36202457"

Test #57:

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

input:

39997 7
1000000
0100000
0010000
0001000
0000100
0000010
0000001

1000000
0100000
0010000
0001000
0000100
0000010
0000001

1000000
0100000
0010000
0001000
0000100
0000010
0000001

1000000
0100000
0010000
0001000
0000100
0000010
0000001

1000000
0100000
0010000
0001000
0000100
0000010
0000001

1000000...

output:

56774053

result:

ok 1 number(s): "56774053"

Test #58:

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

input:

39996 9
100000000
010000000
001000000
000100000
000010000
000001000
000000100
000000010
000000001

100000000
010000000
001000000
000100000
000010000
000001000
000000100
000000010
000000001

100000000
010000000
001000000
000100000
000010000
000001000
000000100
000000010
000000001

100000000
010000000...

output:

69978090

result:

ok 1 number(s): "69978090"

Test #59:

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

input:

39998 3
110
010
111

100
011
101

111
000
101

111
010
001

000
011
001

111
010
101

100
011
001

100
011
101

110
010
001

000
011
000

111
111
001

111
011
000

111
011
001

110
000
111

000
111
111

110
010
101

100
000
001

110
010
001

100
010
101

000
010
111

111
111
000

111
111
000

100
01...

output:

1169370

result:

ok 1 number(s): "1169370"

Test #60:

score: 0
Accepted
time: 73ms
memory: 3720kb

input:

39996 5
11111
01000
00000
00000
11001

11111
01110
00100
10011
00001

11100
01110
00000
11011
10001

10000
00000
11111
00010
00001

11110
01110
00111
00010
10001

00000
01111
11111
00010
00001

11110
11111
10111
00000
11001

11100
01100
00100
00000
11101

10000
11111
10111
11111
11001

11000
01110
0...

output:

97383911

result:

ok 1 number(s): "97383911"

Test #61:

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

input:

39996 7
1000000
0111111
0010000
0001111
0000000
1110011
0000000

1111110
0111000
0011100
1101111
0000100
0000000
1111001

1110000
0111100
0011100
0001110
1100111
0000000
1100001

1000000
0111110
0011110
0001100
1111111
1111111
1000001

0000000
0110000
1011111
1111111
0000000
0000000
1111001

1111110...

output:

687353461

result:

ok 1 number(s): "687353461"

Test #62:

score: 0
Accepted
time: 944ms
memory: 3660kb

input:

39999 9
111111000
011110000
001000000
100111111
100011111
000001111
111111111
111000011
000000000

111111111
111111111
001110000
111111111
000011000
000001110
111100111
111111011
111111001

111110000
010000000
001000000
100111111
000000000
100001111
111100111
000000000
100000001

111111100
011110000...

output:

2628626454

result:

ok 1 number(s): "2628626454"

Test #63:

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

input:

39997 3
100
010
001

100
010
001

100
010
001

100
010
001

100
010
001

100
010
001

100
010
001

100
010
001

100
010
001

100
010
001

100
010
001

100
010
001

100
010
001

100
010
001

100
010
001

100
010
001

100
010
001

100
010
001

100
010
001

100
010
001

100
010
001

100
010
001

100
01...

output:

31212959

result:

ok 1 number(s): "31212959"

Test #64:

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

input:

40000 5
10000
01000
00100
00010
00001

10000
01000
00100
00010
00001

10000
01000
00100
00010
00001

10000
01000
00100
00010
00001

10000
01000
00100
00010
00001

10000
01000
00100
00010
00001

10000
01000
00100
00010
00001

10000
01000
00100
00010
00001

10000
01000
00100
00010
00001

10000
01000
0...

output:

72033835

result:

ok 1 number(s): "72033835"

Test #65:

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

input:

39996 7
1000000
0100000
0010000
0001000
0000100
0000010
0000001

1000000
0100000
0010000
0001000
0000100
0000010
0000001

1000000
0100000
0010000
0001000
0000100
0000010
0000001

1000000
0100000
0010000
0001000
0000100
0000010
0000001

1000000
0100000
0010000
0001000
0000100
0000010
0000001

1000000...

output:

111754272

result:

ok 1 number(s): "111754272"

Test #66:

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

input:

39998 9
100000000
010000000
001000000
000100000
000010000
000001000
000000100
000000010
000000001

100000000
010000000
001000000
000100000
000010000
000001000
000000100
000000010
000000001

100000000
010000000
001000000
000100000
000010000
000001000
000000100
000000010
000000001

100000000
010000000...

output:

164049483

result:

ok 1 number(s): "164049483"

Test #67:

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

input:

39996 3
100
010
001

100
010
001

100
010
001

100
010
001

100
010
001

100
010
001

100
010
001

100
010
001

100
010
001

100
010
001

100
010
001

100
010
001

100
010
001

100
010
001

100
010
001

100
010
001

100
010
001

100
010
001

100
010
001

100
010
001

100
010
001

100
010
001

100
01...

output:

82015092

result:

ok 1 number(s): "82015092"

Test #68:

score: 0
Accepted
time: 63ms
memory: 3576kb

input:

39999 5
10000
01000
00100
00010
00001

10000
01000
00100
00010
00001

10000
01000
00100
00010
00001

10000
01000
00100
00010
00001

10000
01000
00100
00010
00001

10000
01000
00100
00010
00001

10000
01000
00100
00010
00001

10000
01000
00100
00010
00001

10000
01000
00100
00010
00001

10000
01000
0...

output:

145322970

result:

ok 1 number(s): "145322970"

Test #69:

score: 0
Accepted
time: 207ms
memory: 3576kb

input:

39999 7
1000000
0100000
0010000
0001000
0000100
0000010
0000001

1000000
0100000
0010000
0001000
0000100
0000010
0000001

1000000
0100000
0010000
0001000
0000100
0000010
0000001

1000000
0100000
0010000
0001000
0000100
0000010
0000001

1000000
0100000
0010000
0001000
0000100
0000010
0000001

1000000...

output:

243822921

result:

ok 1 number(s): "243822921"

Test #70:

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

input:

39996 9
100000000
010000000
001000000
000100000
000010000
000001000
000000100
000000010
000000001

100000000
010000000
001000000
000100000
000010000
000001000
000000100
000000010
000000001

100000000
010000000
001000000
000100000
000010000
000001000
000000100
000000010
000000001

100000000
010000000...

output:

493567991

result:

ok 1 number(s): "493567991"

Test #71:

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

input:

2 1
1

output:

1

result:

ok 1 number(s): "1"

Test #72:

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

input:

2 1
0

output:

0

result:

ok 1 number(s): "0"