QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#862402#9980. Boolean Function Reconstructionucup-team3188#AC ✓536ms4096kbC++202.4kb2025-01-19 00:42:072025-01-19 00:42:17

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

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

output:

Yes
(a&b)
Yes
(b|a)
Yes
T
Yes
((c&(b|a))|(a&b))
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: 0ms
memory: 3584kb

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: 1ms
memory: 3584kb

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

result:

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

Test #4:

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

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: 52ms
memory: 3584kb

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: 8 out of 18 (65536 test cases)

Test #6:

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

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

result:

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

Test #7:

score: 0
Accepted
time: 15ms
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
((((a&b)&c)&d)&e)
Yes
(((b&c)&d)&e)
Yes
(((a&c)&d)&e)
Yes
(e&(d&(c&(b|a))))
Yes
((c&d)&e)
Yes
(((a&b)&d)&e)
Yes
(e&(d&((c&b)|(a&b))))
Yes
(e&(d&((c&a)|(a&b))))
Yes
(e&(d&((c&(b|a))|(a&b))))
Yes
(e&(d&(c|(a&b))))
Yes
((b&d)&e)
Yes
(e&(d&((c&a)|b)))
Yes
(e&(d&(c|b)))
Yes
((a&d)&e)
Yes
(e&(d&...

result:

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

Test #8:

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

input:

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

output:

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

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

result:

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

Test #10:

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

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

result:

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

Test #11:

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

input:

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

output:

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

result:

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

Test #12:

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

input:

1
15
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000...

output:

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

result:

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

Test #13:

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

input:

1
15
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000100000000000000010000000100010111000000000000000000000000000000000000000...

output:

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

result:

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

Test #14:

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

input:

1
15
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

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

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
((o&((n&((m&((l&((k&((j&((i&((h&((g&(f|(e|(d|(c|(b|a))))))|((f&(e|(d|(c|(b|a)))))|((e&(d|(c|(b|a))))|((d&(c|(b|a)))|((c&(b|a))|(a&b)))))))|((g&((f&(e|(d|(c|(b|a)))))|((e&(d|(c|(b|a))))|((d&(c|(b|a)))|((c&(b|a))|(a&b))))))|((f&((e&(d|(c|(b|a))))|((d&(c|(b|a)))|((c&(b|a))|(a&b)))))|((e&((d&(c|(b|a...

result:

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

Test #16:

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

input:

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

output:

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

result:

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

Test #17:

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

input:

65536
7
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001
7
00000001000100010001000101110111000100010111011101110111011111110001000101110111011101110111111100010001011101110111011111111111
7
000000010001001100000001001101...

output:

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

result:

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

Test #18:

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

input:

16384
8
0000000000000000000000000000000000000000000000000000000000010001000000000000000000000000000100010000000000010001000100010011011100000000000000000000000000010001000000000001000100010001011101110000000000000001000100010011011100010001000101110011011101111111
8
000101010101011100010101011101110...

output:

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

result:

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

Test #19:

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

input:

4096
9
00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000111000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000001000101110000000000000000000000010001011100000...

output:

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

result:

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

Test #20:

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

input:

1024
10
0000000000000000000000000000000100000000000000110000000000000011000000000000000100000000000000110000000000000011000000010000001100000000000000110000000000000011000000000000001100000011000001110000000000000011000000000000001100000011000001110000001100011111000000000000001100000000000000110000...

output:

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

result:

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

Test #21:

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

input:

256
11
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

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

result:

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

Test #22:

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

input:

64
12
000101011111111101111111111111110001011111111111011111111111111100010111111111110111111111111111000101111111111101111111111111110001010111111111011111111111111100010111111111110111111111111111000101111111111101111111111111110001011111111111111111111111111101111111111111111111111111111111011111...

output:

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

result:

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

Test #23:

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

input:

16
13
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000011111111111111111111111111111100000000000000000000000000000000000000...

output:

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

result:

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

Test #24:

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

input:

4
14
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

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

result:

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

Test #25:

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

input:

4
14
0000000000000000000000000000000000000000000000000001000100010101000000000000000101010101010101010001010101010101011101110111111100000000000000000000000000000001000000000000000000010101010101010000000100010001010101010101011101010101010101010111111111111111000000000000000000010101010101010000000...

output:

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

result:

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

Test #26:

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

input:

4
14
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

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

result:

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

Test #27:

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

input:

4
14
0000000000000000000000000001001100000000000000110000000000110011000000000011001100000000001100110000000000110011000000000011001100000000001100110000000000110011000000000011001100000000001100110001001100111111001100111111111100110011111111110011001111111111000000000011001100000011001101110000000...

output:

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

result:

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

Test #28:

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

input:

4
14
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000001000000000000000000000000000000000000000...

output:

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

result:

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

Test #29:

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

input:

1
15
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

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

result:

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

Test #30:

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

input:

1
15
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

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

result:

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

Test #31:

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

input:

1
15
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000...

output:

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

result:

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

Test #32:

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

input:

1
15
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000001100000000000000110000001100111111000000000000000000000000000000000000000...

output:

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

result:

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

Test #33:

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

input:

1
15
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

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

result:

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

Test #34:

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

input:

1
15
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001010100000000000000000000000001010101000000000000000000000000000000000000000...

output:

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

result:

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

Test #35:

score: 0
Accepted
time: 536ms
memory: 3456kb

input:

65536
7
00000000000000010000000100000101000000000001011100000101010111110000000100000001000001110001011100000101001101110011011111111111
7
00000000000000010000000000010111000000000000011100000001011111110000000100000001000000110011011100010101001101110011111111111111
7
000000000000000000000001000100...

output:

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

result:

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

Test #36:

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

input:

1024
10
0000000000000000000000000000000000000000000000000000000000000011000000000000000000000001000001110000000000000111000101010111011100000000000000000000000000000111000000010001011100010011000101110000000100000001000001110001011100000101011111110101111111111111000000000000000100000000000100010000...

output:

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

result:

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

Test #37:

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

input:

64
12
000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000001000101110000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000010000000100010101000101110111111100000000000000000000000000000001000000...

output:

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

result:

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

Test #38:

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

input:

64
12
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000...

output:

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

result:

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

Test #39:

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

input:

64
12
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000...

output:

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

result:

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

Test #40:

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

input:

4
14
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000010111000000000000000000000000000000000000000...

output:

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

result:

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

Test #41:

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

input:

4
14
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000...

output:

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

result:

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

Test #42:

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

input:

1
15
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000100000001000000000000000000000000000000000000000...

output:

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

result:

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

Test #43:

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

input:

1
15
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

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

result:

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

Test #44:

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

input:

1
15
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

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

result:

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

Extra Test:

score: 0
Extra Test Passed