QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#855689#9980. Boolean Function Reconstructionucup-team1878#AC ✓2900ms5920kbC++143.6kb2025-01-13 07:55:302025-01-13 07:55:31

詳細信息

Test #1:

score: 100
Accepted
time: 2711ms
memory: 5368kb

input:

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

output:

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

result:

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

Test #2:

score: 0
Accepted
time: 2714ms
memory: 5332kb

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: 2771ms
memory: 5628kb

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
(a&b)
No
Yes
a
No
Yes
b
No
Yes
(a|b)
Yes
T

result:

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

Test #4:

score: 0
Accepted
time: 2728ms
memory: 5632kb

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|(a&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
N...

result:

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

Test #5:

score: 0
Accepted
time: 2726ms
memory: 5640kb

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|(b&F))|(a&(F|(b&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
...

result:

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

Test #6:

score: 0
Accepted
time: 2739ms
memory: 5384kb

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|(b&F))|(a&(F|(b&F))))
Yes
((F|(b&F))|(a&(F|(b&(c&d)))))
Yes
((F|(b&(c&d)))|(a&(F|(b&(c&d)))))
Yes
((F|(b&F))|(a&((c&d)|(b&(c&d)))))
Yes
((F|(b&(c&d)))|(a&((c&d)|(b&(c&d)))))
Yes
(((c&d)|(b&(c&d)))|(a&((c&d)|(b&(c&d)))))
Yes
((F|(b&F))|(a&(F|(b&d))))
Yes
((F|(b&(c&d)))|(a&(F|(b&d))))
Yes
((F|...

result:

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

Test #7:

score: 0
Accepted
time: 2713ms
memory: 5448kb

input:

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

output:

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

result:

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

Test #8:

score: 0
Accepted
time: 2725ms
memory: 5588kb

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&(b|c)))
Yes
(((c&d)|(b&(c|d)))|(a&((c|d)|(b&T))))
Yes
((a|((b|c)&(d|e)))&((b&c)|((d|e)&((d&e)|(a&(b|c))))))
Yes
(((b|((c|d)&(e|f)))&((c&d)|((e|f)&((e&f)|(b&(c|d))))))|(a&((b&c)|((d&e)|((b|(c|f))&(d|(e|(f&(b|c)))))))))
Yes
((((c|d)&((e|f)&((c&(d&g))|(e&(f&(g|(c&d)))))))|...

result:

ok 14 lines, tightest: 9 out of 18 (14 test cases)

Test #9:

score: 0
Accepted
time: 2709ms
memory: 5516kb

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&(b|c)))
Yes
((F|(b&(c&d)))|(a&((c&d)|(b&(c|d)))))
Yes
((a|((b|c)&(d|e)))&((b&c)|((d|e)&((d&e)|(a&(b|c))))))
Yes
(((b|c)&((d|e)&((b&(c&f))|(d&(e&(f|(b&c)))))))|(a&((b|((c|d)&(e|f)))&((c&d)|((e|f)&((e&f)|(b&(c|d))))))))
Yes
((((c|d)&((e|f)&((c&(d&g))|(e&(f&(g|(c&d)))))))|...

result:

ok 14 lines, tightest: 9 out of 18 (14 test cases)

Test #10:

score: 0
Accepted
time: 2730ms
memory: 5848kb

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
(F|(a&(b&c)))
Yes
((F|(b&(c&d)))|(a&((c&d)|(b&(c|d)))))
Yes
((a|b)&((c|d)&((a&(b&e))|(c&(d&(e|(a&b)))))))
Yes
(((b|c)&((d|e)&((b&(c&f))|(d&(e&(f|(b&c)))))))|(a&((b|((c|d)&(e|f)))&((c&d)|((e|f)&((e&f)|(b&(c|d))))))))
Yes
(((c&(d&(e&(f&g))))|(b&((c|d)&((e|f)&((c&(d&g))|(e&(f&(g|(c&...

result:

ok 14 lines, tightest: 9 out of 18 (14 test cases)

Test #11:

score: 0
Accepted
time: 2773ms
memory: 5628kb

input:

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

output:

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

result:

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

Test #12:

score: 0
Accepted
time: 2735ms
memory: 5532kb

input:

1
15
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000...

output:

Yes
((((((((((F|(j&F))|(i&(F|(j&F))))|(h&((F|(j&F))|(i&(F|(j&(k&(l&(m&(n&o))))))))))|(g&(((F|(j&F))|(i&(F|(j&(k&(l&(m&(n&o))))))))|(h&((F|(j&(k&(l&(m&(n&o))))))|(i&((k&(l&(m&(n&o))))|(j&((k|l)&((m|n)&((k&(l&o))|(m&(n&(o|(k&l)))))))))))))))|(f&((((F|(j&F))|(i&(F|(j&(k&(l&(m&(n&o))))))))|(h&((F|(j&(k&...

result:

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

Test #13:

score: 0
Accepted
time: 2731ms
memory: 5612kb

input:

1
15
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000100000000000000010000000100010111000000000000000000000000000000000000000...

output:

Yes
((((((((((F|(j&F))|(i&(F|(j&(k&(l&(m&(n&o))))))))|(h&((F|(j&(k&(l&(m&(n&o))))))|(i&((k&(l&(m&(n&o))))|(j&((k|l)&((m|n)&((k&(l&o))|(m&(n&(o|(k&l)))))))))))))|(g&(((F|(j&(k&(l&(m&(n&o))))))|(i&((k&(l&(m&(n&o))))|(j&((k|l)&((m|n)&((k&(l&o))|(m&(n&(o|(k&l)))))))))))|(h&(((k&(l&(m&(n&o))))|(j&((k|l)&...

result:

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

Test #14:

score: 0
Accepted
time: 2691ms
memory: 5856kb

input:

1
15
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

Yes
((((((((((F|(j&F))|(i&(F|(j&F))))|(h&((F|(j&F))|(i&(F|(j&F))))))|(g&(((F|(j&F))|(i&(F|(j&F))))|(h&((F|(j&F))|(i&(F|(j&(k&(l&(m&(n&o))))))))))))|(f&((((F|(j&F))|(i&(F|(j&F))))|(h&((F|(j&F))|(i&(F|(j&(k&(l&(m&(n&o))))))))))|(g&(((F|(j&F))|(i&(F|(j&(k&(l&(m&(n&o))))))))|(h&((F|(j&(k&(l&(m&(n&o)))))...

result:

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

Test #15:

score: 0
Accepted
time: 2709ms
memory: 5588kb

input:

1
15
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

Yes
((((((((((F|(j&F))|(i&(F|(j&F))))|(h&((F|(j&F))|(i&(F|(j&F))))))|(g&(((F|(j&F))|(i&(F|(j&F))))|(h&((F|(j&F))|(i&(F|(j&F))))))))|(f&((((F|(j&F))|(i&(F|(j&F))))|(h&((F|(j&F))|(i&(F|(j&F))))))|(g&(((F|(j&F))|(i&(F|(j&F))))|(h&((F|(j&F))|(i&(F|(j&(k&(l&(m&(n&o))))))))))))))|(e&(((((F|(j&F))|(i&(F|(j...

result:

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

Test #16:

score: 0
Accepted
time: 2771ms
memory: 5384kb

input:

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

output:

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

result:

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

Test #17:

score: 0
Accepted
time: 2898ms
memory: 5656kb

input:

65536
7
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001
7
00000001000100010001000101110111000100010111011101110111011111110001000101110111011101110111111100010001011101110111011111111111
7
000000010001001100000001001101...

output:

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

result:

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

Test #18:

score: 0
Accepted
time: 2796ms
memory: 5480kb

input:

16384
8
0000000000000000000000000000000000000000000000000000000000010001000000000000000000000000000100010000000000010001000100010011011100000000000000000000000000010001000000000001000100010001011101110000000000000001000100010011011100010001000101110011011101111111
8
000101010101011100010101011101110...

output:

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

result:

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

Test #19:

score: 0
Accepted
time: 2776ms
memory: 5720kb

input:

4096
9
00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000111000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000001000101110000000000000000000000010001011100000...

output:

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

result:

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

Test #20:

score: 0
Accepted
time: 2723ms
memory: 5536kb

input:

1024
10
0000000000000000000000000000000100000000000000110000000000000011000000000000000100000000000000110000000000000011000000010000001100000000000000110000000000000011000000000000001100000011000001110000000000000011000000000000001100000011000001110000001100011111000000000000001100000000000000110000...

output:

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

result:

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

Test #21:

score: 0
Accepted
time: 2724ms
memory: 5480kb

input:

256
11
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

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

result:

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

Test #22:

score: 0
Accepted
time: 2712ms
memory: 5496kb

input:

64
12
000101011111111101111111111111110001011111111111011111111111111100010111111111110111111111111111000101111111111101111111111111110001010111111111011111111111111100010111111111110111111111111111000101111111111101111111111111110001011111111111111111111111111101111111111111111111111111111111011111...

output:

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

result:

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

Test #23:

score: 0
Accepted
time: 2706ms
memory: 5768kb

input:

16
13
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000011111111111111111111111111111100000000000000000000000000000000000000...

output:

Yes
((((((((F|(h&(i&(j&(k&(l&m))))))|(g&(F|(h&(j&(i|(k|(l|m))))))))|(f&((F|(h&j))|(g&((j&(i|(l&m)))|(h&(i|(j|((k|l)&(m|(k&l)))))))))))|(e&(((F|(h&(i&(j&(k|(l|m))))))|(g&((i&(j&(k&(l&m))))|(h&(j|(i&((k|l)&(m|(k&l)))))))))|(f&(((i&(j&((k|l)&(m|(k&l)))))|(h&(j|(i&(k|(l|m))))))|(g&(j|(h&T))))))))|(d&(((...

result:

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

Test #24:

score: 0
Accepted
time: 2701ms
memory: 5596kb

input:

4
14
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

Yes
(((((((((F|(i&F))|(h&(F|(i&F))))|(g&((F|(i&F))|(h&(F|(i&F))))))|(f&((((j&(k&(l&m)))|(i&(l&((j|k)&(m|(j&k))))))|(h&((j&(k&(l&m)))|(i&((j|l)&((k&m)|(j&(l&(k|(m|n))))))))))|(g&(((j&(k&(l&m)))|(i&(l&((j|k)&(m|(j&k))))))|(h&((j&(k&(l&m)))|(i&((j|l)&((k&m)|(j&(l&(k|(m|n))))))))))))))|(e&((((F|(i&(j&(k...

result:

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

Test #25:

score: 0
Accepted
time: 2747ms
memory: 5592kb

input:

4
14
0000000000000000000000000000000000000000000000000001000100010101000000000000000101010101010101010001010101010101011101110111111100000000000000000000000000000001000000000000000000010101010101010000000100010001010101010101011101010101010101010111111111111111000000000000000000010101010101010000000...

output:

Yes
(((((((((F|(i&F))|(h&(F|(i&F))))|(g&((F|(i&(j&(k&n))))|(h&(F|(i&(n&((j&k)|(l&(j|(k&m)))))))))))|(f&(((F|(i&F))|(h&(F|(i&F))))|(g&(((j&(k&n))|(i&(n|(j&k))))|(h&((j&(n&(k|l)))|(i&(n|((j&k)|(l&(j|(k&m)))))))))))))|(e&((((F|(i&(j&(k&(l&n)))))|(h&(F|(i&(j&(k&n))))))|(g&(((n&(j|(k&l)))|(i&(j|(k|n))))|...

result:

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

Test #26:

score: 0
Accepted
time: 2713ms
memory: 5572kb

input:

4
14
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

Yes
(((((((((F|(i&F))|(h&(F|(i&F))))|(g&((F|(i&F))|(h&(F|(i&F))))))|(f&(((F|(i&F))|(h&(F|(i&F))))|(g&((F|(i&F))|(h&(F|(i&F))))))))|(e&((((F|(i&F))|(h&(F|(i&F))))|(g&((F|(i&F))|(h&(F|(i&F))))))|(f&(((F|(i&F))|(h&(F|(i&F))))|(g&((F|(i&F))|(h&(F|(i&(j&(l&(m&n)))))))))))))|(d&(((((F|(i&F))|(h&(F|(i&F)))...

result:

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

Test #27:

score: 0
Accepted
time: 2705ms
memory: 5828kb

input:

4
14
0000000000000000000000000001001100000000000000110000000000110011000000000011001100000000001100110000000000110011000000000011001100000000001100110000000000110011000000000011001100000000001100110001001100111111001100111111111100110011111111110011001111111111000000000011001100000011001101110000000...

output:

Yes
((((((((((j&(k&(l&(m&n))))|(i&((l|n)&((k&m)|(n&(l|(j&(k|m))))))))|(h&((n&((j|(k|m))&(l|(j&(k&m)))))|(i&(l|(n|(j&(k&m))))))))|(g&(((l&(n&(j|(k|m))))|(i&(n|(l&(j|(k|m))))))|(h&(((l&n)|((k|m)&(n|(l&(j|(k&m))))))|(i&(k|(l|(m|n)))))))))|(f&((((k&(l&(m&n)))|(i&((k|(l|m))&(n|(k&(l&m))))))|(h&(((l&n)|(k...

result:

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

Test #28:

score: 0
Accepted
time: 2742ms
memory: 5812kb

input:

4
14
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000001000000000000000000000000000000000000000...

output:

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

result:

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

Test #29:

score: 0
Accepted
time: 2706ms
memory: 5820kb

input:

1
15
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

Yes
((((((((((F|(j&F))|(i&(F|(j&F))))|(h&((F|(j&F))|(i&(F|(j&F))))))|(g&(((F|(j&F))|(i&(F|(j&F))))|(h&((F|(j&F))|(i&(F|(j&F))))))))|(f&((((F|(j&F))|(i&(F|(j&F))))|(h&((F|(j&F))|(i&(F|(j&F))))))|(g&(((F|(j&F))|(i&(F|(j&F))))|(h&((F|(j&F))|(i&(F|(j&F))))))))))|(e&(((((F|(j&F))|(i&(F|(j&F))))|(h&((F|(j...

result:

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

Test #30:

score: 0
Accepted
time: 2727ms
memory: 5644kb

input:

1
15
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

Yes
((((((((((F|(j&F))|(i&(F|(j&F))))|(h&((F|(j&(l&(m&(n&o)))))|(i&((k&(l&(m&(n&o))))|(j&(o&((l|m)&(n|(l&m))))))))))|(g&(((F|(j&F))|(i&(F|(j&F))))|(h&((F|(j&(l&(m&(n&o)))))|(i&((l&(m&(n&o)))|(j&(o&(m|(l&n)))))))))))|(f&((((F|(j&F))|(i&(F|(j&(l&(m&(n&o)))))))|(h&((F|(j&(m&(o&(l|n)))))|(i&((l&(m&(n&o)...

result:

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

Test #31:

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

input:

1
15
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000...

output:

Yes
((((((((((F|(j&F))|(i&(F|(j&F))))|(h&((F|(j&F))|(i&(F|(j&F))))))|(g&(((F|(j&F))|(i&(F|(j&F))))|(h&((F|(j&F))|(i&(F|(j&(m&(n&(o&(k|l))))))))))))|(f&((((F|(j&F))|(i&(F|(j&F))))|(h&((F|(j&F))|(i&(F|(j&(m&(n&(o&(k|l))))))))))|(g&(((F|(j&F))|(i&(F|(j&(k&(l&(m&(n&o))))))))|(h&((F|(j&(m&(n&(o&(k|l)))))...

result:

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

Test #32:

score: 0
Accepted
time: 2730ms
memory: 5604kb

input:

1
15
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000001100000000000000110000001100111111000000000000000000000000000000000000000...

output:

Yes
((((((((((F|(j&F))|(i&(F|(j&F))))|(h&((F|(j&F))|(i&((k&(l&(m&n)))|(j&(k&(n&(l|m)))))))))|(g&(((F|(j&F))|(i&(F|(j&(k&(l&(m&n)))))))|(h&((F|(j&(k&(l&(m&n)))))|(i&(((k|l)&((m|n)&((k&l)|(m&n))))|(j&((k|n)&((k&n)|(l&(m|(n&o)))))))))))))|(f&((((F|(j&F))|(i&(F|(j&(k&(l&(m&n)))))))|(h&((F|(j&(k&(l&(m&n)...

result:

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

Test #33:

score: 0
Accepted
time: 2705ms
memory: 5596kb

input:

1
15
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

Yes
((((((((((F|(j&F))|(i&(F|(j&F))))|(h&((F|(j&F))|(i&(F|(j&F))))))|(g&(((F|(j&F))|(i&(F|(j&F))))|(h&((F|(j&F))|(i&(F|(j&F))))))))|(f&((((F|(j&F))|(i&(F|(j&F))))|(h&((F|(j&F))|(i&(F|(j&F))))))|(g&(((F|(j&F))|(i&(F|(j&F))))|(h&((F|(j&F))|(i&(F|(j&F))))))))))|(e&(((((F|(j&F))|(i&(F|(j&F))))|(h&((F|(j...

result:

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

Test #34:

score: 0
Accepted
time: 2712ms
memory: 5632kb

input:

1
15
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001010100000000000000000000000001010101000000000000000000000000000000000000000...

output:

Yes
((((((((((F|(j&F))|(i&(F|(j&(k&(m&n))))))|(h&(((k&(m&(n&o)))|(j&(k&(n&(m|(l&o))))))|(i&((k&(n&(m|(l&o))))|(j&((k|m)&(n|(k&m)))))))))|(g&(((F|(j&(k&(m&(n&(l|o))))))|(i&((k&(m&n))|(j&(n&((k&(l|m))|(o&(k|(l&m)))))))))|(h&(((k&(n&(m|(l&o))))|(j&((k|n)&((k&n)|(m&(l|o))))))|(i&(((k|m)&(n|(k&m)))|(j&((...

result:

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

Test #35:

score: 0
Accepted
time: 2900ms
memory: 5420kb

input:

65536
7
00000000000000010000000100000101000000000001011100000101010111110000000100000001000001110001011100000101001101110011011111111111
7
00000000000000010000000000010111000000000000011100000001011111110000000100000001000000110011011100010101001101110011111111111111
7
000000000000000000000001000100...

output:

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

result:

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

Test #36:

score: 0
Accepted
time: 2761ms
memory: 5740kb

input:

1024
10
0000000000000000000000000000000000000000000000000000000000000011000000000000000000000001000001110000000000000111000101010111011100000000000000000000000000000111000000010001011100010011000101110000000100000001000001110001011100000101011111110101111111111111000000000000000100000000000100010000...

output:

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

result:

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

Test #37:

score: 0
Accepted
time: 2745ms
memory: 5772kb

input:

64
12
000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000001000101110000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000010000000100010101000101110111111100000000000000000000000000000001000000...

output:

Yes
(((((((F|(g&(h&(i&(j&(k&l))))))|(f&(F|(g&(h&(l&((i|j)&(k|(i&j)))))))))|(e&((F|(g&(i&(j&(l&(h|k))))))|(f&((h&(i&(k&l)))|(g&((k|(j&l))&((h&j)|(i&l)))))))))|(d&(((F|(g&(i&(l&((h|j)&(k|(h&j)))))))|(f&((h&(i&(j&(k&l))))|(g&((h|i)&((j|l)&((i&(h|k))|(l&(j|k)))))))))|(e&(((h&(i&(j&k)))|(g&((h|i)&((j|(k|...

result:

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

Test #38:

score: 0
Accepted
time: 2718ms
memory: 5504kb

input:

64
12
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000...

output:

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

result:

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

Test #39:

score: 0
Accepted
time: 2718ms
memory: 5488kb

input:

64
12
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000...

output:

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

result:

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

Test #40:

score: 0
Accepted
time: 2738ms
memory: 5568kb

input:

4
14
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000010111000000000000000000000000000000000000000...

output:

Yes
(((((((((F|(i&F))|(h&(F|(i&(j&(k&(l&(m&n))))))))|(g&((F|(i&F))|(h&((j&(k&(l&(m&n))))|(i&(j&(m&((k|l)&(n|(k&l)))))))))))|(f&(((F|(i&F))|(h&((j&(k&(l&(m&n))))|(i&(l&(m&((j|k)&(n|(j&k)))))))))|(g&(((j&(k&(l&(m&n))))|(i&(j&(l&(n&(k|m))))))|(h&((j&(m&(n&(k|l))))|(i&((j|k)&((m|(j&l))&(n|(j&(k|(l&m))))...

result:

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

Test #41:

score: 0
Accepted
time: 2744ms
memory: 5616kb

input:

4
14
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000...

output:

Yes
(((((((((F|(i&F))|(h&(F|(i&F))))|(g&((F|(i&F))|(h&(F|(i&F))))))|(f&(((F|(i&F))|(h&(F|(i&(j&(k&(l&(m&n))))))))|(g&((F|(i&(j&(k&(l&(m&n))))))|(h&((j&(k&(l&(m&n))))|(i&(j&(k&(l&(m|n))))))))))))|(e&((((F|(i&F))|(h&(F|(i&(j&(k&(l&(m&n))))))))|(g&((F|(i&(j&(k&(l&(m&n))))))|(h&((j&(k&(l&(m&n))))|(i&(j&...

result:

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

Test #42:

score: 0
Accepted
time: 2699ms
memory: 5536kb

input:

1
15
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000100000001000000000000000000000000000000000000000...

output:

Yes
((((((((((F|(j&F))|(i&(F|(j&F))))|(h&((F|(j&F))|(i&(F|(j&(m&((k|l)&((n|o)&((k&l)|(n&o)))))))))))|(g&(((F|(j&(k&(l&(m&(n&o))))))|(i&((k&(l&(m&(n&o))))|(j&(k&(m&((l|n)&(o|(l&n)))))))))|(h&((F|(j&(l&(m&(o&(k|n))))))|(i&((k&(m&(n&(l|o))))|(j&((k|n)&((m|o)&((m&o)|(k&(l|n)))))))))))))|(f&((((F|(j&F))|...

result:

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

Test #43:

score: 0
Accepted
time: 2715ms
memory: 5920kb

input:

1
15
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

Yes
((((((((((F|(j&F))|(i&(F|(j&F))))|(h&((F|(j&F))|(i&(F|(j&(k&(l&(m&(n&o))))))))))|(g&(((F|(j&F))|(i&(F|(j&(k&(l&(m&(n&o))))))))|(h&((F|(j&(k&(l&(m&(n&o))))))|(i&((k&(l&(m&(n&o))))|(j&(k&(l&(m&(n|o))))))))))))|(f&((((F|(j&F))|(i&(F|(j&(k&(l&(m&(n&o))))))))|(h&((F|(j&(k&(l&(m&(n&o))))))|(i&((k&(l&(...

result:

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

Test #44:

score: 0
Accepted
time: 2711ms
memory: 5664kb

input:

1
15
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

Yes
((((((((((F|(j&F))|(i&(F|(j&F))))|(h&((F|(j&F))|(i&(F|(j&F))))))|(g&(((F|(j&F))|(i&(F|(j&F))))|(h&((F|(j&F))|(i&(F|(j&(k&(l&(m&(n&o))))))))))))|(f&((((F|(j&F))|(i&(F|(j&F))))|(h&((F|(j&F))|(i&(F|(j&(k&(l&(m&(n&o))))))))))|(g&(((F|(j&F))|(i&(F|(j&F))))|(h&((F|(j&F))|(i&((k&(l&(m&(n&o))))|(j&(m&(n...

result:

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

Extra Test:

score: 0
Extra Test Passed