QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#855678#9980. Boolean Function Reconstructionucup-team1878#WA 183ms5820kbC++143.4kb2025-01-13 07:17:002025-01-13 07:17:00

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 2ms
memory: 5160kb

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

result:

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

Test #2:

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

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

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

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: 10ms
memory: 5064kb

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

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

result:

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

Test #7:

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

input:

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

output:

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

result:

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

Test #8:

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

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

result:

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

Test #9:

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

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

result:

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

Test #10:

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

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

result:

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

Test #11:

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

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

result:

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

Test #12:

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

input:

1
15
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000...

output:

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

result:

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

Test #13:

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

input:

1
15
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000100000000000000010000000100010111000000000000000000000000000000000000000...

output:

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

result:

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

Test #14:

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

input:

1
15
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

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

result:

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

Test #15:

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

input:

1
15
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

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

result:

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

Test #16:

score: 0
Accepted
time: 88ms
memory: 5192kb

input:

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

output:

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

result:

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

Test #17:

score: 0
Accepted
time: 183ms
memory: 5204kb

input:

65536
7
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001
7
00000001000100010001000101110111000100010111011101110111011111110001000101110111011101110111111100010001011101110111011111111111
7
000000010001001100000001001101...

output:

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

result:

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

Test #18:

score: -100
Wrong Answer
time: 91ms
memory: 5136kb

input:

16384
8
0000000000000000000000000000000000000000000000000000000000010001000000000000000000000000000100010000000000010001000100010011011100000000000000000000000000010001000000000001000100010001011101110000000000000001000100010011011100010001000101110011011101111111
8
000101010101011100010101011101110...

output:

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

result:

wrong answer 140 operations, you can't use more than 138 operations (test case 6791)