QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#862147#9980. Boolean Function Reconstructionucup-team3602#AC ✓266ms4540kbC++2057.9kb2025-01-18 22:15:342025-01-18 22:15:36

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

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

result:

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

Test #2:

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

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: 3840kb

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: 0ms
memory: 3968kb

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: 21ms
memory: 3840kb

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

Test #6:

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

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

result:

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

Test #7:

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

input:

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

output:

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

result:

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

Test #8:

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

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

result:

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

Test #9:

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

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

result:

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

Test #10:

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

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

result:

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

Test #11:

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

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

result:

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

Test #12:

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

input:

1
15
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000...

output:

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

result:

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

Test #13:

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

input:

1
15
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000100000000000000010000000100010111000000000000000000000000000000000000000...

output:

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

result:

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

Test #14:

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

input:

1
15
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

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

result:

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

Test #15:

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

input:

1
15
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

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

result:

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

Test #16:

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

input:

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

output:

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

result:

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

Test #17:

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

input:

65536
7
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001
7
00000001000100010001000101110111000100010111011101110111011111110001000101110111011101110111111100010001011101110111011111111111
7
000000010001001100000001001101...

output:

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

result:

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

Test #18:

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

input:

16384
8
0000000000000000000000000000000000000000000000000000000000010001000000000000000000000000000100010000000000010001000100010011011100000000000000000000000000010001000000000001000100010001011101110000000000000001000100010011011100010001000101110011011101111111
8
000101010101011100010101011101110...

output:

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

result:

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

Test #19:

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

input:

4096
9
00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000111000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000001000101110000000000000000000000010001011100000...

output:

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

result:

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

Test #20:

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

input:

1024
10
0000000000000000000000000000000100000000000000110000000000000011000000000000000100000000000000110000000000000011000000010000001100000000000000110000000000000011000000000000001100000011000001110000000000000011000000000000001100000011000001110000001100011111000000000000001100000000000000110000...

output:

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

result:

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

Test #21:

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

input:

256
11
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

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

result:

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

Test #22:

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

input:

64
12
000101011111111101111111111111110001011111111111011111111111111100010111111111110111111111111111000101111111111101111111111111110001010111111111011111111111111100010111111111110111111111111111000101111111111101111111111111110001011111111111111111111111111101111111111111111111111111111111011111...

output:

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

result:

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

Test #23:

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

input:

16
13
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000011111111111111111111111111111100000000000000000000000000000000000000...

output:

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

result:

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

Test #24:

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

input:

4
14
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

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

result:

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

Test #25:

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

input:

4
14
0000000000000000000000000000000000000000000000000001000100010101000000000000000101010101010101010001010101010101011101110111111100000000000000000000000000000001000000000000000000010101010101010000000100010001010101010101011101010101010101010111111111111111000000000000000000010101010101010000000...

output:

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

result:

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

Test #26:

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

input:

4
14
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

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

result:

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

Test #27:

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

input:

4
14
0000000000000000000000000001001100000000000000110000000000110011000000000011001100000000001100110000000000110011000000000011001100000000001100110000000000110011000000000011001100000000001100110001001100111111001100111111111100110011111111110011001111111111000000000011001100000011001101110000000...

output:

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

result:

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

Test #28:

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

input:

4
14
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000001000000000000000000000000000000000000000...

output:

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

result:

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

Test #29:

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

input:

1
15
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

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

result:

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

Test #30:

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

input:

1
15
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

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

result:

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

Test #31:

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

input:

1
15
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000...

output:

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

result:

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

Test #32:

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

input:

1
15
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000001100000000000000110000001100111111000000000000000000000000000000000000000...

output:

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

result:

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

Test #33:

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

input:

1
15
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

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

result:

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

Test #34:

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

input:

1
15
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001010100000000000000000000000001010101000000000000000000000000000000000000000...

output:

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

result:

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

Test #35:

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

input:

65536
7
00000000000000010000000100000101000000000001011100000101010111110000000100000001000001110001011100000101001101110011011111111111
7
00000000000000010000000000010111000000000000011100000001011111110000000100000001000000110011011100010101001101110011111111111111
7
000000000000000000000001000100...

output:

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

result:

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

Test #36:

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

input:

1024
10
0000000000000000000000000000000000000000000000000000000000000011000000000000000000000001000001110000000000000111000101010111011100000000000000000000000000000111000000010001011100010011000101110000000100000001000001110001011100000101011111110101111111111111000000000000000100000000000100010000...

output:

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

result:

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

Test #37:

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

input:

64
12
000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000001000101110000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000010000000100010101000101110111111100000000000000000000000000000001000000...

output:

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

result:

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

Test #38:

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

input:

64
12
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000...

output:

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

result:

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

Test #39:

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

input:

64
12
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000...

output:

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

result:

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

Test #40:

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

input:

4
14
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000010111000000000000000000000000000000000000000...

output:

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

result:

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

Test #41:

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

input:

4
14
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000...

output:

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

result:

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

Test #42:

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

input:

1
15
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000100000001000000000000000000000000000000000000000...

output:

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

result:

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

Test #43:

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

input:

1
15
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

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

result:

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

Test #44:

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

input:

1
15
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

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

result:

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

Extra Test:

score: 0
Extra Test Passed