QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#866640#9980. Boolean Function Reconstructionucup-team3479#AC ✓388ms3968kbC++206.4kb2025-01-22 16:47:172025-01-22 16:47:17

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

7
2
0001
2
0111
2
1111
3
00010111
1
10
2
0101
5
00000000000000000000000000000001

output:

Yes
(b&a)
Yes
(a|b)
Yes
T
Yes
((b|(c&a))&(c|a))
No
Yes
a
Yes
(e&(c&(d&(a&b))))

result:

ok 7 lines, tightest: 4 out of 14 (7 test cases)

Test #2:

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

input:

4
1
00
1
10
1
01
1
11

output:

Yes
F
No
Yes
a
Yes
T

result:

ok 4 lines, tightest: 0 out of 11 (4 test cases)

Test #3:

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

input:

16
2
0000
2
1000
2
0100
2
1100
2
0010
2
1010
2
0110
2
1110
2
0001
2
1001
2
0101
2
1101
2
0011
2
1011
2
0111
2
1111

output:

Yes
F
No
No
No
No
No
No
No
Yes
(b&a)
No
Yes
a
No
Yes
b
No
Yes
(b|a)
Yes
T

result:

ok 16 lines, tightest: 1 out of 12 (16 test cases)

Test #4:

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

input:

256
3
00000000
3
10000000
3
01000000
3
11000000
3
00100000
3
10100000
3
01100000
3
11100000
3
00010000
3
10010000
3
01010000
3
11010000
3
00110000
3
10110000
3
01110000
3
11110000
3
00001000
3
10001000
3
01001000
3
11001000
3
00101000
3
10101000
3
01101000
3
11101000
3
00011000
3
10011000
3
01011000...

output:

Yes
F
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
...

result:

ok 256 lines, tightest: 4 out of 14 (256 test cases)

Test #5:

score: 0
Accepted
time: 22ms
memory: 3712kb

input:

65536
4
0000000000000000
4
1000000000000000
4
0100000000000000
4
1100000000000000
4
0010000000000000
4
1010000000000000
4
0110000000000000
4
1110000000000000
4
0001000000000000
4
1001000000000000
4
0101000000000000
4
1101000000000000
4
0011000000000000
4
1011000000000000
4
0111000000000000
4
1111000...

output:

Yes
F
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
...

result:

ok 65536 lines, tightest: 10 out of 18 (65536 test cases)

Test #6:

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

input:

168
4
0000000000000000
4
0000000000000001
4
0000000000000011
4
0000000000000101
4
0000000000000111
4
0000000000001111
4
0000000000010001
4
0000000000010011
4
0000000000010101
4
0000000000010111
4
0000000000011111
4
0000000000110011
4
0000000000110111
4
0000000000111111
4
0000000001010101
4
000000000...

output:

Yes
F
Yes
(b&(c&(d&a)))
Yes
(c&(d&b))
Yes
((b|(c&(d&a)))&(c&(d&a)))
Yes
((b|(c&(a&d)))&(c&d))
Yes
(c&((b|d)&d))
Yes
(b&(a&d))
Yes
((c|(d&(b&a)))&(d&b))
Yes
(a&((c|(d&b))&d))
Yes
((b|(a&(d&c)))&((a|(d&c))&d))
Yes
((c|(d&(b&a)))&d)
Yes
((a|((c|(d&b))&(d&b)))&((c|(d&b))&(d&b)))
Yes
((a|(d&b))&(d&(c|b))...

result:

ok 168 lines, tightest: 10 out of 18 (168 test cases)

Test #7:

score: 0
Accepted
time: 11ms
memory: 3584kb

input:

7581
5
00000000000000000000000000000000
5
00000000000000000000000000000001
5
00000000000000000000000000000011
5
00000000000000000000000000000101
5
00000000000000000000000000000111
5
00000000000000000000000000001111
5
00000000000000000000000000010001
5
00000000000000000000000000010011
5
0000000000000...

output:

Yes
F
Yes
(c&(e&(d&(a&b))))
Yes
(d&(b&(c&e)))
Yes
(c&(e&((b|(d&a))&(d&a))))
Yes
(e&((b|(a&(d&c)))&((a|(d&c))&(d&c))))
Yes
(c&((b|((a|(e&d))&(e&d)))&((a|(e&d))&(e&d))))
Yes
((c|(e&(a&(d&b))))&(e&(a&(d&b))))
Yes
(d&(b&((a|(c&e))&e)))
Yes
((c|(d&(e&(a&b))))&(d&(e&a)))
Yes
((b|(d&(e&(a&c))))&(d&(e&(a|c)...

result:

ok 7581 lines, tightest: 22 out of 26 (7581 test cases)

Test #8:

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

input:

14
1
01
2
0111
3
00010111
4
0001011101111111
5
00000001000101110001011101111111
6
0000000100010111000101110111111100010111011111110111111111111111
7
00000000000000010000000100010111000000010001011100010111011111110000000100010111000101110111111100010111011111110111111111111111
8
00000000000000010000...

output:

Yes
a
Yes
(a|b)
Yes
((b|(c&a))&(c|a))
Yes
((d|((c|(a&b))&(a|b)))&(c|(a|b)))
Yes
((d|((b|(c&(a&e)))&((c|(a&e))&(a|e))))&((b|((c|(a&e))&(a|e)))&(c|(a|e))))
Yes
((c|((e|((f|(d&(a&b)))&((d|(a&b))&(a|b))))&((f|((d|(a&b))&(a|b)))&(d|(a|b)))))&((e|((f|((d|(a&b))&(a|b)))&(d|(a|b))))&(f|(d|(a|b)))))
Yes
((e|...

result:

ok 14 lines, tightest: 68 out of 74 (14 test cases)

Test #9:

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

input:

14
1
01
2
0001
3
00010111
4
0000000100010111
5
00000001000101110001011101111111
6
0000000000000001000000010001011100000001000101110001011101111111
7
00000000000000010000000100010111000000010001011100010111011111110000000100010111000101110111111100010111011111110111111111111111
8
00000000000000000000...

output:

Yes
a
Yes
(a&b)
Yes
((b|(c&a))&(c|a))
Yes
((d|(c&(a&b)))&((c|(a&b))&(a|b)))
Yes
((d|((b|(c&(a&e)))&((c|(a&e))&(a|e))))&((b|((c|(a&e))&(a|e)))&(c|(a|e))))
Yes
((c|((e|(f&(d&(a&b))))&((f|(d&(a&b)))&((d|(a&b))&(a|b)))))&((e|((f|(d&(a&b)))&((d|(a&b))&(a|b))))&((f|((d|(a&b))&(a|b)))&(d|(a|b)))))
Yes
((e|...

result:

ok 14 lines, tightest: 68 out of 74 (14 test cases)

Test #10:

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

input:

14
1
00
2
0001
3
00000001
4
0000000100010111
5
00000000000000010000000100010111
6
0000000000000001000000010001011100000001000101110001011101111111
7
00000000000000000000000000000001000000000000000100000001000101110000000000000001000000010001011100000001000101110001011101111111
8
00000000000000000000...

output:

Yes
F
Yes
(a&b)
Yes
(b&(c&a))
Yes
((d|(c&(a&b)))&((c|(a&b))&(a|b)))
Yes
((d|(b&(c&(a&e))))&((b|(c&(a&e)))&((c|(a&e))&(a|e))))
Yes
((c|((e|(f&(d&(a&b))))&((f|(d&(a&b)))&((d|(a&b))&(a|b)))))&((e|((f|(d&(a&b)))&((d|(a&b))&(a|b))))&((f|((d|(a&b))&(a|b)))&(d|(a|b)))))
Yes
((e|((c|(b&(d&(a&(g&f)))))&((b|(...

result:

ok 14 lines, tightest: 33 out of 42 (14 test cases)

Test #11:

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

input:

14
1
00
2
0000
3
00000001
4
0000000000000001
5
00000000000000010000000100010111
6
0000000000000000000000000000000100000000000000010000000100010111
7
00000000000000000000000000000001000000000000000100000001000101110000000000000001000000010001011100000001000101110001011101111111
8
00000000000000000000...

output:

Yes
F
Yes
F
Yes
(b&(c&a))
Yes
(d&(c&(a&b)))
Yes
((d|(b&(c&(a&e))))&((b|(c&(a&e)))&((c|(a&e))&(a|e))))
Yes
((c|(e&(f&(d&(a&b)))))&((e|(f&(d&(a&b))))&((f|(d&(a&b)))&((d|(a&b))&(a|b)))))
Yes
((e|((c|(b&(d&(a&(g&f)))))&((b|(d&(a&(g&f))))&((d|(a&(g&f)))&((a|(g&f))&(g|f))))))&((c|((b|(d&(a&(g&f))))&((d|(a...

result:

ok 14 lines, tightest: 0 out of 11 (14 test cases)

Test #12:

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

input:

1
15
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000...

output:

Yes
((e|((l|((k|((g|((o|((b|((j|(c&(f&(a&(n&(d&(i&(h&m))))))))&((c|(f&(a&(n&(d&(i&(h&m)))))))&((f|(a&(n&(d&(i&(h&m))))))&((a|(n&(d&(i&(h&m)))))&((n|(d&(i&(h&m))))&((d|(i&(h&m)))&((i|(h&m))&(h|m)))))))))&((j|((c|(f&(a&(n&(d&(i&(h&m)))))))&((f|(a&(n&(d&(i&(h&m))))))&((a|(n&(d&(i&(h&m)))))&((n|(d&(i&(h...

result:

ok 1 lines, tightest: 12868 out of 16394 (1 test case)

Test #13:

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

input:

1
15
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000100000000000000010000000100010111000000000000000000000000000000000000000...

output:

Yes
((e|((l|((k|((g|((o|((b|((j|((c|(f&(a&(n&(d&(i&(h&m)))))))&((f|(a&(n&(d&(i&(h&m))))))&((a|(n&(d&(i&(h&m)))))&((n|(d&(i&(h&m))))&((d|(i&(h&m)))&((i|(h&m))&(h|m))))))))&((c|((f|(a&(n&(d&(i&(h&m))))))&((a|(n&(d&(i&(h&m)))))&((n|(d&(i&(h&m))))&((d|(i&(h&m)))&((i|(h&m))&(h|m)))))))&((f|((a|(n&(d&(i&(...

result:

ok 1 lines, tightest: 11438 out of 16394 (1 test case)

Test #14:

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

input:

1
15
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

Yes
((e|((l|((k|((g|((o|((b|(j&(c&(f&(a&(n&(d&(i&(h&m)))))))))&((j|(c&(f&(a&(n&(d&(i&(h&m))))))))&((c|(f&(a&(n&(d&(i&(h&m)))))))&((f|(a&(n&(d&(i&(h&m))))))&((a|(n&(d&(i&(h&m)))))&((n|(d&(i&(h&m))))&((d|(i&(h&m)))&((i|(h&m))&(h|m))))))))))&((b|((j|(c&(f&(a&(n&(d&(i&(h&m))))))))&((c|(f&(a&(n&(d&(i&(h&...

result:

ok 1 lines, tightest: 11438 out of 16394 (1 test case)

Test #15:

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

input:

1
15
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

Yes
((e|((l|((k|((g|((o|(b&(j&(c&(f&(a&(n&(d&(i&(h&m))))))))))&((b|(j&(c&(f&(a&(n&(d&(i&(h&m)))))))))&((j|(c&(f&(a&(n&(d&(i&(h&m))))))))&((c|(f&(a&(n&(d&(i&(h&m)))))))&((f|(a&(n&(d&(i&(h&m))))))&((a|(n&(d&(i&(h&m)))))&((n|(d&(i&(h&m))))&((d|(i&(h&m)))&((i|(h&m))&(h|m)))))))))))&((o|((b|(j&(c&(f&(a&(...

result:

ok 1 lines, tightest: 8006 out of 16394 (1 test case)

Test #16:

score: 0
Accepted
time: 168ms
memory: 3712kb

input:

65536
6
0000001101111111000111111111111101111111111111111111111111111111
6
0000000000000000000100110011011100000000000000000001001100111111
6
0101010101110111011101111111111101110111111111111111111111111111
6
0000001100000011000000110001011100011111001111110011111100111111
6
000000010001011100000001...

output:

Yes
((e|((d|((c|((a|(f&b))&f))&((a|(f|b))&(f|b))))&(c|(a|(f|b)))))&(d|(c|((a|f)&(f|b)))))
Yes
((d|((f|(e&(b&(a|c))))&(e&(b&(a|c)))))&((f|(e&(b|(a&c))))&(e&(b|c))))
Yes
((f|((c|((d|(a|(b&e)))&(a|(b|e))))&((d|(a|(b&e)))&(a|(b|e)))))&((c|(d|(a|(b|e))))&(d|(a|(b|e)))))
Yes
((a|((f|(c&((e|b)&b)))&(c|((e|...

result:

ok 65536 lines, tightest: 42 out of 42 (65536 test cases)

Test #17:

score: 0
Accepted
time: 350ms
memory: 3712kb

input:

65536
7
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001
7
00000001000100010001000101110111000100010111011101110111011111110001000101110111011101110111111100010001011101110111011111111111
7
000000010001001100000001001101...

output:

Yes
(e&(d&(c&(g&(f&(b&a))))))
Yes
((b|((a|((f|(g&(e&(c&d))))&((g|(e&(c&d)))&(e&d))))&((f|((g|(e&d))&(e|d)))&((g|(e|d))&(e|d)))))&((a|((f|((g|(e&d))&(e|d)))&((g|(e|d))&(e|d))))&(f|(g|(e|(c|d))))))
Yes
((b|((e|(d&((g|((c|(f&a))&f))&((c|(f&a))&f))))&((d|((g|(c&(f&a)))&(c&(f&a))))&((g|((c|(f&a))&(f|a)))...

result:

ok 65536 lines, tightest: 74 out of 74 (65536 test cases)

Test #18:

score: 0
Accepted
time: 186ms
memory: 3840kb

input:

16384
8
0000000000000000000000000000000000000000000000000000000000010001000000000000000000000000000100010000000000010001000100010011011100000000000000000000000000010001000000000001000100010001011101110000000000000001000100010011011100010001000101110011011101111111
8
000101010101011100010101011101110...

output:

Yes
((e|((d|(h&(g&(f&(b&a)))))&((h|(g&(f&(b&a))))&((g|(f&(b&a)))&((f|(b&(a&c)))&((b|(a&c))&(a|c)))))))&((d|((h|(g&(f&(b&a))))&((g|(f&(b&a)))&((f|(b&a))&(b|(a&c))))))&((h|((g|(f&(b&a)))&((f|(b&a))&(b|(a&c)))))&((g|((f|(b&a))&(b|a)))&((f|(b|(a&c)))&(b|(a|c)))))))
Yes
((f|((g|((h|((a|((e|(c&(d&b)))&((c...

result:

ok 16384 lines, tightest: 138 out of 138 (16384 test cases)

Test #19:

score: 0
Accepted
time: 111ms
memory: 3712kb

input:

4096
9
00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000111000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000001000101110000000000000000000000010001011100000...

output:

Yes
((e|((d|((h|(g&(i&(b&(a&(c&f))))))&(g&(i&(b&(a&(c&f)))))))&((h|((g|(i&(b&(a&(c&f)))))&(i&((b|(a&(c&f)))&((a|(c&f))&f)))))&((g|(i&(b&(a&(c&f)))))&(i&((b|(a&(c&f)))&((a|(c&f))&f)))))))&((d|((h|((g|(i&((b|((a|(c&f))&f))&((a|f)&(c|f)))))&(i&((b|((a|(c&f))&(c|f)))&(a|(c|f))))))&((g|(i&((b|((a|(c&f))&...

result:

ok 4096 lines, tightest: 266 out of 266 (4096 test cases)

Test #20:

score: 0
Accepted
time: 77ms
memory: 3712kb

input:

1024
10
0000000000000000000000000000000100000000000000110000000000000011000000000000000100000000000000110000000000000011000000010000001100000000000000110000000000000011000000000000001100000011000001110000000000000011000000000000001100000011000001110000001100011111000000000000001100000000000000110000...

output:

Yes
((e|((d|((h|((g|((i|(b&(j&(c&(f|a)))))&((b|(j&(c&f)))&((j|(c&(f&a)))&c))))&((i|(b&(j&c)))&((b|(j&(c&f)))&((j|(c&f))&(c|f))))))&((g|((i|((b|(j&(c&(f&a))))&(j&c)))&((b|(j&(c&f)))&((j|(c&f))&(c|f)))))&((i|((b|(j&(c&f)))&((j|(c&f))&(c|(f&a)))))&((b|(j&(c&(f|a))))&((j|(c&f))&(c|f)))))))&((h|((g|((i|(...

result:

ok 1024 lines, tightest: 522 out of 522 (1024 test cases)

Test #21:

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

input:

256
11
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

Yes
((e|((d|((k|((g|((i|(b&(j&(c&(f&h)))))&((b|(j&(c&(f&h))))&((j|(c&(f&(a&h))))&((c|(f&h))&(f|h))))))&((i|(b&(j&(c&(f&h)))))&((b|(j&(c&(f&h))))&((j|(c&(f&h)))&((c|(f&h))&(f|h)))))))&((g|((i|(b&(j&(c&(f&h)))))&((b|(j&((c|(f&(a&h)))&(f&h))))&((j|(c&(f&h)))&((c|(f&h))&(f|h))))))&((i|(b&(j&(c&(f&h)))))...

result:

ok 256 lines, tightest: 1029 out of 1034 (256 test cases)

Test #22:

score: 0
Accepted
time: 22ms
memory: 3712kb

input:

64
12
000101011111111101111111111111110001011111111111011111111111111100010111111111110111111111111111000101111111111101111111111111110001010111111111011111111111111100010111111111110111111111111111000101111111111101111111111111110001011111111111111111111111111101111111111111111111111111111111011111...

output:

Yes
((e|((l|((k|((g|((i|((b|((j|((c|((f|((a|d)&d))&((a|d)&d)))&((f|(a|d))&(a|d))))&((c|((f|((a|d)&d))&((a|d)&d)))&((f|(a|d))&(a|d)))))&((j|((c|((f|(a|d))&(a|d)))&(f|(a|d))))&(c|((f|(a|d))&(a|d))))))&(b|((j|(c|((f|(a|d))&(a|d))))&(c|((f|(a|d))&(a|(h|d))))))))&((i|((b|((j|((c|((f|((a|d)&d))&((a|d)&d))...

result:

ok 64 lines, tightest: 2014 out of 2058 (64 test cases)

Test #23:

score: 0
Accepted
time: 12ms
memory: 3840kb

input:

16
13
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000011111111111111111111111111111100000000000000000000000000000000000000...

output:

Yes
((e|((l|((k|((g|((m|((b|((j|(c&(f&(a&(h&(d&i))))))&((c|(f&((a|h)&h)))&((f|((a|(h&(d&i)))&(h&(d&i))))&((a|h)&h)))))&((j|(c&(f&((a|(h&i))&(h&i)))))&((c|((f|(a&(h&(d&i))))&((a|h)&h)))&((f|((a|(h&i))&(h&i)))&((a|(h|(d&i)))&(h|(d&i))))))))&((b|((j|(c&(f&((a|(h&(d&i)))&(h&(d&i))))))&((c|(f&((a|h)&h)))...

result:

ok 16 lines, tightest: 4080 out of 4106 (16 test cases)

Test #24:

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

input:

4
14
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

Yes
((e|((l|((k|((g|((m|(b&(j&(c&(f&((a|(n&((d|(i&h))&(i&h))))&((n|((d|(i&h))&(i&h)))&((d|i)&i))))))))&((b|(j&(c&(f&((a|(n&((d|(i&h))&(i&h))))&((n|((d|(i&h))&(i&h)))&((d|i)&i)))))))&((j|(c&(f&(a&(n&((d|(i&h))&(i&h)))))))&((c|(f&((a|(n&((d|(i&h))&(i&h))))&((n|((d|(i&h))&(i&h)))&((d|i)&i)))))&(f&((a|(...

result:

ok 4 lines, tightest: 8002 out of 8202 (4 test cases)

Test #25:

score: 0
Accepted
time: 8ms
memory: 3968kb

input:

4
14
0000000000000000000000000000000000000000000000000001000100010101000000000000000101010101010101010001010101010101011101110111111100000000000000000000000000000001000000000000000000010101010101010000000100010001010101010101011101010101010101010111111111111111000000000000000000010101010101010000000...

output:

Yes
((e|((l|((k|((g|((m|((b|((j|((c|(f&(a&(n&((d|i)&i)))))&((f|(a&(n&(d&i))))&(a&((n|(d&i))&((d|i)&(i|h)))))))&((c|((f|(a&(n&(d&i))))&(a&((n|(d&i))&(d|i)))))&((f|(a&(n&((d|i)&i))))&((a|(n&(d&(i&h))))&(n|((d|i)&i)))))))&((j|((c|((f|(a&(n&(d&i))))&(a&((n|(d&i))&(d|i)))))&((f|(a&(n&((d|i)&i))))&((a|(n&...

result:

ok 4 lines, tightest: 7217 out of 8202 (4 test cases)

Test #26:

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

input:

4
14
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

Yes
((e|((l|((k|(g&(m&(b&(j&(c&(f&((a|(n&(d&(i&h))))&(n&(d&(i&h)))))))))))&(g&(m&(b&(j&(c&(f&((a|(n&(d&(i&h))))&(n&(d&(i&h))))))))))))&((k|((g|((m|((b|(j&(c&(f&((a|(n&(d&i)))&(n&(d&i)))))))&((j|(c&((f|((a|(n&(d&(i&h))))&(n&(d&(i&h)))))&((a|(n&(d&i)))&(n&(d&i))))))&(c&((f|((a|(n&(d&i)))&(n&(d&i))))&(...

result:

ok 4 lines, tightest: 7111 out of 8202 (4 test cases)

Test #27:

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

input:

4
14
0000000000000000000000000001001100000000000000110000000000110011000000000011001100000000001100110000000000110011000000000011001100000000001100110000000000110011000000000011001100000000001100110001001100111111001100111111111100110011111111110011001111111111000000000011001100000011001101110000000...

output:

Yes
((e|((l|((k|((g|((m|((b|((j|((c|((f|((a|((n|(d&(i&h)))&((d|(i&h))&(i|h))))&((n|(d&(i&h)))&((d|(i&h))&(i|h)))))&((a|((n|(d&(i&h)))&((d|(i&h))&(i|h))))&((n|(d&(i&h)))&((d|(i&h))&(i|h))))))&((f|((a|((n|(d&(i&h)))&((d|(i&h))&(i|h))))&((n|(d&(i&h)))&((d|(i&h))&(i|h)))))&((a|((n|(d&(i&h)))&((d|(i&h))&...

result:

ok 4 lines, tightest: 4819 out of 8202 (4 test cases)

Test #28:

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

input:

4
14
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000001000000000000000000000000000000000000000...

output:

Yes
((e|((l|((k|((g|((m|((b|(j&(c&((f|(a&((n|(d&(i&h)))&(d&i))))&(a&((n|(d&i))&(d&i)))))))&((j|(c&((f|(a&((n|(d&(i&h)))&(d&i))))&(a&((n|(d&i))&(d&i))))))&((c|((f|(a&((n|(d&(i&h)))&(d&i))))&(a&((n|(d&i))&(d&(i|h))))))&((f|((a|((n|(d&i))&(d&(i|h))))&((n|(d|i))&(d|i))))&((a|((n|d)&(d|(i&h))))&(n|(d|(i|...

result:

ok 4 lines, tightest: 6452 out of 8202 (4 test cases)

Test #29:

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

input:

1
15
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

Yes
((e|((l|((k|((g|(o&(b&((j|(c&(f&(a&(n&(d&(i&(h&m))))))))&(c&(f&(a&(n&(d&(i&h))))))))))&(o&(b&((j|(c&(f&(a&(n&(d&(i&(h&m))))))))&(c&(f&(a&(n&(d&(i&h)))))))))))&((g|(o&((b|(j&(c&(f&(a&(n&(d&(i&(h&m)))))))))&((j|(c&(f&(a&(n&(d&(i&h)))))))&(c&(f&(a&(n&(d&((i|(h&m))&h))))))))))&(o&((b|(j&(c&(f&(a&(n&...

result:

ok 1 lines, tightest: 1565 out of 16394 (1 test case)

Test #30:

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

input:

1
15
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

Yes
((e|((l|((k|((g|((o|((b|((j|(c&(f&((a|(n&(d&(i&(h&m)))))&(n&(d&(i&(h&m))))))))&((c|(f&((a|(n&(d&(i&(h&m)))))&(n&(d&(i&(h&m)))))))&((f|((a|((n|(d&(i&(h&m))))&(d&(i&(h&m)))))&((n|(d&(i&(h&m))))&(d&(i&(h&m))))))&((a|((n|(d&(i&(h&m))))&((d|(i&(h&m)))&((i|(h&m))&(h|m)))))&((n|(d&(i&(h&m))))&((d|(i&(h...

result:

ok 1 lines, tightest: 14550 out of 16394 (1 test case)

Test #31:

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

input:

1
15
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000...

output:

Yes
((e|((l|((k|((g|((o|((b|((j|(c&(f&(a&(n&(d&(i&(h&m))))))))&(c&((f|(a&(n&(d&(i&(h&m))))))&((a|(n&(d&(i&(h&m)))))&(n&((d|(i&(h&m)))&(i&(h&m)))))))))&((j|((c|(f&(a&(n&(d&(i&(h&m)))))))&((f|(a&(n&((d|(i&(h&m)))&(i&(h&m))))))&((a|(n&((d|(i&(h&m)))&(i&(h&m)))))&((n|(d&(i&(h&m))))&((d|((i|(h&m))&h))&((...

result:

ok 1 lines, tightest: 12915 out of 16394 (1 test case)

Test #32:

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

input:

1
15
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000001100000000000000110000001100111111000000000000000000000000000000000000000...

output:

Yes
((e|((l|((k|((g|((o|((b|((j|((c|(f&((a|(n&(d&(i&(h&m)))))&(n&(d&(i&(h&m)))))))&((f|((a|(n&(d&(i&h))))&(n&((d|(i&(h&m)))&(i&h)))))&((a|((n|(d&(i&(h&m))))&((d|(i&h))&((i|(h&m))&(h|m)))))&((n|(d&(i&h)))&((d|(i&h))&((i|(h&m))&(h|m))))))))&((c|((f|(a&(n&(d&(i&(h&m))))))&((a|(n&(d&(i&h))))&(n&((d|(i&(...

result:

ok 1 lines, tightest: 12774 out of 16394 (1 test case)

Test #33:

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

input:

1
15
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

Yes
((e|((l|((k|((g|(o&((b|((j|(c&(f&(a&(n&(d&(i&(h&m))))))))&(c&(f&(a&((n|(d&(i&(h&m))))&(d&(i&(h&m)))))))))&((j|((c|(f&(a&((n|(d&(i&(h&m))))&(d&(i&(h&m)))))))&((f|(a&(n&(d&(i&(h&m))))))&((a|(n&(d&(i&(h&m)))))&((n|(d&((i|(h&m))&(h&m))))&(d&((i|(h&m))&h)))))))&((c|(f&(a&((n|(d&(i&(h&m))))&(d&((i|(h&...

result:

ok 1 lines, tightest: 6131 out of 16394 (1 test case)

Test #34:

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

input:

1
15
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001010100000000000000000000000001010101000000000000000000000000000000000000000...

output:

Yes
((e|((l|((k|((g|((o|((b|((j|((c|((f|((a|(n&(d&(i&(h&m)))))&(n&((d|(i&(h&m)))&((i|(h&m))&(h|m))))))&((a|(n&(d&(i&(h&m)))))&((n|(d&(i&(h&m))))&((d|((i|(h&m))&(h&m)))&((i|(h&m))&(h|m)))))))&((f|((a|(n&(d&(i&(h&m)))))&((n|(d&(i&(h&m))))&((d|(i&(h&m)))&((i|(h&m))&(h|m))))))&((a|(n&((d|(i&(h&m)))&((i|...

result:

ok 1 lines, tightest: 14051 out of 16394 (1 test case)

Test #35:

score: 0
Accepted
time: 388ms
memory: 3584kb

input:

65536
7
00000000000000010000000100000101000000000001011100000101010111110000000100000001000001110001011100000101001101110011011111111111
7
00000000000000010000000000010111000000000000011100000001011111110000000100000001000000110011011100010101001101110011111111111111
7
000000000000000000000001000100...

output:

Yes
((e|((d|(c&(g&((f|(b&a))&a))))&((c|((g|(f&(b&a)))&(f&b)))&((g|((f|(b&a))&(b|a)))&((f|(b&a))&(b|a))))))&((d|((c|(g&(f&b)))&((g|((f|(b&a))&a))&((f|(b|a))&(b|a)))))&((c|((g|(f&a))&(f|(b&a))))&((g|(f|a))&(f|(b|a))))))
Yes
((b|((a|(f&((g|(e&(c&d)))&(e&(c|d)))))&((f|((g|(e&(c&d)))&(e&(c&d))))&((g|((e|...

result:

ok 65536 lines, tightest: 74 out of 74 (65536 test cases)

Test #36:

score: 0
Accepted
time: 78ms
memory: 3840kb

input:

1024
10
0000000000000000000000000000000000000000000000000000000000000011000000000000000000000001000001110000000000000111000101010111011100000000000000000000000000000111000000010001011100010011000101110000000100000001000001110001011100000101011111110101111111111111000000000000000100000000000100010000...

output:

Yes
((e|((d|((h|((g|((i|(b&(j&(c&(f&a)))))&((b|(j&(c&(f&a))))&(j&(c&(f|a))))))&((i|((b|(j&(c&(f&a))))&(j&((c|(f&a))&(f|a)))))&((b|((j|(c&(f&a)))&(c&(f&a))))&((j|((c|(f&a))&(f&a)))&(c|f))))))&((g|((i|((b|(j&(c&(f&a))))&((j|(c&(f&a)))&(c&f))))&((b|(j&((c|(f&a))&(f|a))))&((j|((c|(f&a))&(f|a)))&((c|(f&a...

result:

ok 1024 lines, tightest: 472 out of 522 (1024 test cases)

Test #37:

score: 0
Accepted
time: 24ms
memory: 3712kb

input:

64
12
000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000001000101110000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000010000000100010101000101110111111100000000000000000000000000000001000000...

output:

Yes
((e|((l|((k|((g|((i|(b&(j&(c&(f&((a|(h&d))&(h&d)))))))&((b|((j|(c&(f&(a&(h&d)))))&((c|(f&(a&(h&d))))&((f|(a&(h&d)))&((a|(h&d))&h)))))&((j|((c|(f&(a&(h&d))))&(f&(a&h))))&((c|((f|(a&(h&d)))&(a&d)))&((f|((a|(h&d))&(h|d)))&(a|d)))))))&((i|((b|((j|(c&(f&(a&(h&d)))))&((c|(f&(a&(h&d))))&((f|(a&(h&d)))&...

result:

ok 64 lines, tightest: 1652 out of 2058 (64 test cases)

Test #38:

score: 0
Accepted
time: 24ms
memory: 3840kb

input:

64
12
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000...

output:

Yes
((e|((l|((k|((g|(i&(b&(j&((c|(f&(a&(h&d))))&(f&((a|(h&d))&(h|d))))))))&((i|(b&(j&(c&((f|(a&(h&d)))&((a|(h&d))&h))))))&((b|((j|(c&(f&(a&(h&d)))))&(c&((f|(a&(h&d)))&((a|(h&d))&h)))))&((j|(c&(f&(a&(h&d)))))&((c|((f|(a&(h&d)))&((a|(h&d))&(h|d))))&((f|(a&d))&((a|d)&(h|d)))))))))&((g|((i|(b&((j|(c&(f&...

result:

ok 64 lines, tightest: 1468 out of 2058 (64 test cases)

Test #39:

score: 0
Accepted
time: 22ms
memory: 3840kb

input:

64
12
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000...

output:

Yes
((e|((l|((k|((g|(i&(b&(j&(c&(f&(a&(h&d))))))))&((i|(b&(j&(c&(f&(a&(h&d)))))))&(b&(j&((c|(f&(a&(h&d))))&((f|(a&(h&d)))&(a&d))))))))&((g|((i|(b&(j&(c&(f&(a&(h&d)))))))&((b|(j&(c&(f&(a&(h&d))))))&((j|(c&(f&(a&(h&d)))))&(c&(f&(a&d)))))))&((i|((b|(j&(c&(f&(a&(h&d))))))&(j&((c|(f&(a&(h&d))))&((f|(a&(h...

result:

ok 64 lines, tightest: 989 out of 2058 (64 test cases)

Test #40:

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

input:

4
14
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000010111000000000000000000000000000000000000000...

output:

Yes
((e|((l|((k|((g|((m|((b|((j|(c&(f&(a&(n&(d&(i&h)))))))&((c|(f&(a&(n&(d&(i&h))))))&(f&((a|(n&(d&(i&h))))&((n|(d&(i&h)))&((d|(i&h))&h)))))))&((j|((c|(f&(a&(n&(d&(i&h))))))&(f&((a|(n&(d&(i&h))))&((n|(d&(i&h)))&(d&h))))))&((c|(f&(a&((n|(d&(i&h)))&((d|(i&h))&h)))))&((f|(a&((n|(d&(i&h)))&(d&(i&h)))))&...

result:

ok 4 lines, tightest: 6022 out of 8202 (4 test cases)

Test #41:

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

input:

4
14
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000...

output:

Yes
((e|((l|((k|((g|((m|((b|(j&(c&(f&(a&(n&(d&(i&h))))))))&(j&(c&((f|(a&(n&(d&(i&h)))))&((a|(n&(d&(i&h))))&((n|(d&(i&h)))&((d|(i&h))&(i&h)))))))))&((b|((j|(c&(f&(a&(n&(d&(i&h)))))))&((c|(f&(a&(n&(d&(i&h))))))&((f|(a&(n&(d&(i&h)))))&(a&((n|(d&(i&h)))&((d|(i&h))&(i|h))))))))&((j|((c|(f&(a&(n&(d&(i&h))...

result:

ok 4 lines, tightest: 5383 out of 8202 (4 test cases)

Test #42:

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

input:

1
15
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000100000001000000000000000000000000000000000000000...

output:

Yes
((e|((l|((k|((g|((o|((b|((j|(c&(f&(a&(n&(d&((i|(h&m))&m)))))))&((c|(f&(a&((n|(d&(i&(h&m))))&((d|(i&(h&m)))&((i|(h&m))&m))))))&((f|((a|(n&(d&(i&(h&m)))))&((n|(d&(i&(h&m))))&(d&(i&m)))))&((a|(n&((d|(i&(h&m)))&((i|(h&m))&h))))&((n|((d|(i&(h&m)))&(i&m)))&((d|(i&m))&(i|h))))))))&((j|((c|((f|(a&(n&(d&...

result:

ok 1 lines, tightest: 11358 out of 16394 (1 test case)

Test #43:

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

input:

1
15
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

Yes
((e|((l|((k|((g|((o|((b|(j&(c&((f|(a&(n&(d&(i&(h&m))))))&((a|(n&(d&(i&(h&m)))))&(n&(d&((i|(h&m))&m))))))))&((j|(c&(f&((a|(n&(d&(i&(h&m)))))&((n|(d&(i&(h&m))))&((d|(i&(h&m)))&(i&(h&m))))))))&((c|(f&(a&((n|(d&(i&(h&m))))&(d&((i|(h&m))&(h&m)))))))&((f|((a|(n&(d&(i&(h&m)))))&(n&(d&(i&m)))))&((a|((n|...

result:

ok 1 lines, tightest: 11154 out of 16394 (1 test case)

Test #44:

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

input:

1
15
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

Yes
((e|((l|((k|((g|((o|((b|(j&(c&(f&(a&(n&(d&(i&(h&m)))))))))&(j&((c|(f&(a&(n&(d&(i&(h&m)))))))&((f|(a&(n&(d&(i&(h&m))))))&((a|(n&(d&(i&(h&m)))))&((n|(d&(i&(h&m))))&(d&(i&h)))))))))&((b|(j&(c&(f&(a&((n|(d&(i&(h&m))))&(d&((i|(h&m))&(h|m)))))))))&((j|((c|(f&(a&(n&(d&(i&(h&m)))))))&((f|(a&(n&(d&(i&(h&...

result:

ok 1 lines, tightest: 9011 out of 16394 (1 test case)

Extra Test:

score: 0
Extra Test Passed