QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#875446 | #9980. Boolean Function Reconstruction | ucup-team5008# | AC ✓ | 588ms | 4096kb | C++20 | 1.4kb | 2025-01-29 19:51:44 | 2025-01-29 19:51:45 |
Judging History
answer
#include <cstdio>
#include <cassert>
#include <string>
const int N = 1 << 15;
int t, n;
bool ok = 1;
char s[N + 1];
std::string run(int mask = 0, int rest = 0) {
if (mask + 1 == (1 << n)) {
if (s[rest] == '0') return "F";
return "T";
}
int best = -1, mx_diff = 0;
for (int i = 0; i < n; ++i) if (mask >> i & 1 ^ 1) {
int opp = (1 << n) - 1 ^ mask ^ (1 << i), diff = 0;
for (int j = opp;; j = (j - 1) & opp) {
if (s[rest | j | (1 << i)] != s[rest | j]) {
if (s[rest | j] == '1') ok = 0;
++diff;
}
if (!j) break;
}
if (diff > mx_diff) {
mx_diff = diff;
best = i;
}
}
if (mx_diff == 0) {
if (s[rest] == '0') return "F";
return "T";
}
std::string X = run(mask | 1 << best, rest), Y = run(mask | 1 << best, rest | 1 << best);
if (X == "T") return "T";
if (Y == "F") return X;
if (X == "F") {
if (Y == "T") return std::string() + char('a' + best);
return '(' + Y + '&' + char('a' + best) + ')';
}
if (Y == "T") return '(' + X + '|' + char('a' + best) + ')';
return '(' + X + "|(" + char('a' + best) + '&' + Y + "))";
}
int main() {
scanf("%d", &t);
while (t--) {
scanf("%d", &n);
scanf("%s", s);
ok = 1;
auto ans = run();
if (ok) {
printf("Yes\n");
int op = 0;
for (int i = 0; i < ans.size(); ++i) if (ans[i] == '&' || ans[i] == '|') ++op;
assert(op <= (1 << n - 1) + 10);
printf("%s\n", ans.c_str());
} else printf("No\n");
}
return 0;
}
这程序好像有点Bug,我给组数据试试?
详细
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 (b&a) Yes (b|a) Yes T Yes ((c&b)|(a&(c|b))) No Yes a Yes ((((e&d)&c)&b)&a)
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 (b&a) No Yes a No Yes b No Yes (b|a) Yes T
result:
ok 16 lines, tightest: 1 out of 12 (16 test cases)
Test #4:
score: 0
Accepted
time: 0ms
memory: 3840kb
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: 39ms
memory: 3968kb
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: 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 (((d&c)&b)&a) Yes ((d&c)&b) Yes ((d&c)&a) Yes (((b|a)&d)&c) Yes (d&c) Yes ((d&b)&a) Yes (((c|a)&d)&b) Yes (((c|b)&d)&a) Yes (((c&b)|(a&(c|b)))&d) Yes (((b&a)|c)&d) Yes (d&b) Yes (((c&a)|b)&d) Yes ((c|b)&d) Yes (d&a) Yes (((c&b)|a)&d) Yes ((c|a)&d) Yes ((b|a)&d) Yes (((c|b)|a)&d) Yes d Yes ...
result:
ok 168 lines, tightest: 8 out of 18 (168 test cases)
Test #7:
score: 0
Accepted
time: 9ms
memory: 3968kb
input:
7581 5 00000000000000000000000000000000 5 00000000000000000000000000000001 5 00000000000000000000000000000011 5 00000000000000000000000000000101 5 00000000000000000000000000000111 5 00000000000000000000000000001111 5 00000000000000000000000000010001 5 00000000000000000000000000010011 5 0000000000000...
output:
Yes F Yes ((((e&d)&c)&b)&a) Yes (((e&d)&c)&b) Yes (((e&d)&c)&a) Yes ((((b|a)&e)&d)&c) Yes ((e&d)&c) Yes (((e&d)&b)&a) Yes ((((c|a)&e)&d)&b) Yes ((((c|b)&e)&d)&a) Yes ((((c&b)|(a&(c|b)))&e)&d) Yes ((((b&a)|c)&e)&d) Yes ((e&d)&b) Yes ((((c&a)|b)&e)&d) Yes (((c|b)&e)&d) Yes ((e&d)&a) Yes ((((c&b)|a)&e)...
result:
ok 7581 lines, tightest: 18 out of 26 (7581 test cases)
Test #8:
score: 0
Accepted
time: 3ms
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&(c|b))) Yes (((d&c)|(b&(d|c)))|(a&((d|c)|b))) Yes ((((e&d)&c)|(b&((e&d)|(c&(e|d)))))|(a&(((e&d)|(c&(e|d)))|(b&((e|d)|c))))) Yes (((((f&e)&d)|(c&((f&e)|(d&(f|e)))))|(b&(((f&e)|(d&(f|e)))|(c&((f|e)|d)))))|(a&((((f&e)|(d&(f|e)))|(c&((f|e)|d)))|(b&(((f|e)|d)|c))))) Yes ((((...
result:
ok 14 lines, tightest: 68 out of 74 (14 test cases)
Test #9:
score: 0
Accepted
time: 3ms
memory: 3968kb
input:
14 1 01 2 0001 3 00010111 4 0000000100010111 5 00000001000101110001011101111111 6 0000000000000001000000010001011100000001000101110001011101111111 7 00000000000000010000000100010111000000010001011100010111011111110000000100010111000101110111111100010111011111110111111111111111 8 00000000000000000000...
output:
Yes a Yes (b&a) Yes ((c&b)|(a&(c|b))) Yes (((d&c)&b)|(a&((d&c)|(b&(d|c))))) Yes ((((e&d)&c)|(b&((e&d)|(c&(e|d)))))|(a&(((e&d)|(c&(e|d)))|(b&((e|d)|c))))) Yes (((((f&e)&d)&c)|(b&(((f&e)&d)|(c&((f&e)|(d&(f|e)))))))|(a&((((f&e)&d)|(c&((f&e)|(d&(f|e)))))|(b&(((f&e)|(d&(f|e)))|(c&((f|e)|d))))))) Yes ((((...
result:
ok 14 lines, tightest: 68 out of 74 (14 test cases)
Test #10:
score: 0
Accepted
time: 1ms
memory: 4096kb
input:
14 1 00 2 0001 3 00000001 4 0000000100010111 5 00000000000000010000000100010111 6 0000000000000001000000010001011100000001000101110001011101111111 7 00000000000000000000000000000001000000000000000100000001000101110000000000000001000000010001011100000001000101110001011101111111 8 00000000000000000000...
output:
Yes F Yes (b&a) Yes ((c&b)&a) Yes (((d&c)&b)|(a&((d&c)|(b&(d|c))))) Yes ((((e&d)&c)&b)|(a&(((e&d)&c)|(b&((e&d)|(c&(e|d))))))) Yes (((((f&e)&d)&c)|(b&(((f&e)&d)|(c&((f&e)|(d&(f|e)))))))|(a&((((f&e)&d)|(c&((f&e)|(d&(f|e)))))|(b&(((f&e)|(d&(f|e)))|(c&((f|e)|d))))))) Yes ((((((g&f)&e)&d)&c)|(b&((((g&f)&...
result:
ok 14 lines, tightest: 33 out of 42 (14 test cases)
Test #11:
score: 0
Accepted
time: 3ms
memory: 3968kb
input:
14 1 00 2 0000 3 00000001 4 0000000000000001 5 00000000000000010000000100010111 6 0000000000000000000000000000000100000000000000010000000100010111 7 00000000000000000000000000000001000000000000000100000001000101110000000000000001000000010001011100000001000101110001011101111111 8 00000000000000000000...
output:
Yes F Yes F Yes ((c&b)&a) Yes (((d&c)&b)&a) Yes ((((e&d)&c)&b)|(a&(((e&d)&c)|(b&((e&d)|(c&(e|d))))))) Yes (((((f&e)&d)&c)&b)|(a&((((f&e)&d)&c)|(b&(((f&e)&d)|(c&((f&e)|(d&(f|e))))))))) Yes ((((((g&f)&e)&d)&c)|(b&((((g&f)&e)&d)|(c&(((g&f)&e)|(d&((g&f)|(e&(g|f)))))))))|(a&(((((g&f)&e)&d)|(c&(((g&f)&e)|...
result:
ok 14 lines, tightest: 0 out of 11 (14 test cases)
Test #12:
score: 0
Accepted
time: 2ms
memory: 3968kb
input:
1 15 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000...
output:
Yes ((((((((((((((o&n)&m)&l)&k)&j)&i)&h)|(g&(((((((o&n)&m)&l)&k)&j)&i)|(h&((((((o&n)&m)&l)&k)&j)|(i&(((((o&n)&m)&l)&k)|(j&((((o&n)&m)&l)|(k&(((o&n)&m)|(l&((o&n)|(m&(o|n)))))))))))))))|(f&((((((((o&n)&m)&l)&k)&j)&i)|(h&((((((o&n)&m)&l)&k)&j)|(i&(((((o&n)&m)&l)&k)|(j&((((o&n)&m)&l)|(k&(((o&n)&m)|(l&((...
result:
ok 1 lines, tightest: 12868 out of 16394 (1 test case)
Test #13:
score: 0
Accepted
time: 3ms
memory: 3968kb
input:
1 15 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000100000000000000010000000100010111000000000000000000000000000000000000000...
output:
Yes ((((((((((((((o&n)&m)&l)&k)&j)&i)|(h&((((((o&n)&m)&l)&k)&j)|(i&(((((o&n)&m)&l)&k)|(j&((((o&n)&m)&l)|(k&(((o&n)&m)|(l&((o&n)|(m&(o|n)))))))))))))|(g&(((((((o&n)&m)&l)&k)&j)|(i&(((((o&n)&m)&l)&k)|(j&((((o&n)&m)&l)|(k&(((o&n)&m)|(l&((o&n)|(m&(o|n)))))))))))|(h&((((((o&n)&m)&l)&k)|(j&((((o&n)&m)&l)|...
result:
ok 1 lines, tightest: 11438 out of 16394 (1 test case)
Test #14:
score: 0
Accepted
time: 2ms
memory: 4096kb
input:
1 15 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...
output:
Yes ((((((((((((((o&n)&m)&l)&k)&j)&i)&h)&g)|(f&((((((((o&n)&m)&l)&k)&j)&i)&h)|(g&(((((((o&n)&m)&l)&k)&j)&i)|(h&((((((o&n)&m)&l)&k)&j)|(i&(((((o&n)&m)&l)&k)|(j&((((o&n)&m)&l)|(k&(((o&n)&m)|(l&((o&n)|(m&(o|n)))))))))))))))))|(e&(((((((((o&n)&m)&l)&k)&j)&i)&h)|(g&(((((((o&n)&m)&l)&k)&j)&i)|(h&((((((o&n...
result:
ok 1 lines, tightest: 11438 out of 16394 (1 test case)
Test #15:
score: 0
Accepted
time: 1ms
memory: 3840kb
input:
1 15 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...
output:
Yes ((((((((((((((o&n)&m)&l)&k)&j)&i)&h)&g)&f)|(e&(((((((((o&n)&m)&l)&k)&j)&i)&h)&g)|(f&((((((((o&n)&m)&l)&k)&j)&i)&h)|(g&(((((((o&n)&m)&l)&k)&j)&i)|(h&((((((o&n)&m)&l)&k)&j)|(i&(((((o&n)&m)&l)&k)|(j&((((o&n)&m)&l)|(k&(((o&n)&m)|(l&((o&n)|(m&(o|n)))))))))))))))))))|(d&((((((((((o&n)&m)&l)&k)&j)&i)&h...
result:
ok 1 lines, tightest: 8006 out of 16394 (1 test case)
Test #16:
score: 0
Accepted
time: 172ms
memory: 3840kb
input:
65536 6 0000001101111111000111111111111101111111111111111111111111111111 6 0000000000000000000100110011011100000000000000000001001100111111 6 0101010101110111011101111111111101110111111111111111111111111111 6 0000001100000011000000110001011100011111001111110011111100111111 6 000000010001011100000001...
output:
Yes (((((e&b)&a)|(c&(e|b)))|(f&(((e|c)|b)|a)))|(d&((((f|e)|c)|b)|a))) Yes (((((f|a)&d)&c)|(b&((d|c)|a)))&e) Yes ((((f&e)|(d&(f|e)))|(b&((f|e)|d)))|a) Yes (((((e&d)&a)|(f&((e|d)|a)))&b)|(c&((((e&d)&a)|f)|b))) Yes ((((f|d)&c)&a)|(b&(((f&d)|(c&(f|d)))|(a&((f|d)|c))))) Yes (((((f&e)&c)&b)|(a&(((f&e)&c)|...
result:
ok 65536 lines, tightest: 33 out of 42 (65536 test cases)
Test #17:
score: 0
Accepted
time: 369ms
memory: 3840kb
input:
65536 7 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 7 00000001000100010001000101110111000100010111011101110111011111110001000101110111011101110111111100010001011101110111011111111111 7 000000010001001100000001001101...
output:
Yes ((((((g&f)&e)&d)&c)&b)&a) Yes ((((((g&f)|(c&(g|f)))&e)&d)|(b&(((g|f)&e)|(d&((g|f)|e)))))|(a&((((g|f)&e)|(d&((g|f)|e)))|(b&((((g|f)|e)|d)|c))))) Yes (((((f&e)&c)&a)|(d&(((e&c)&a)|(f&(((g&e)|c)|a)))))|(b&(((((g&e)|a)&c)|(f&((e|c)|a)))|(d&(((f|e)|c)|a))))) Yes (((((g&b)|(a&(g|b)))&f)&c)|(d&(((((e|a...
result:
ok 65536 lines, tightest: 68 out of 74 (65536 test cases)
Test #18:
score: 0
Accepted
time: 195ms
memory: 3840kb
input:
16384 8 0000000000000000000000000000000000000000000000000000000000010001000000000000000000000000000100010000000000010001000100010011011100000000000000000000000000010001000000000001000100010001011101110000000000000001000100010011011100010001000101110011011101111111 8 000101010101011100010101011101110...
output:
Yes (((((((h&g)&f)&e)&d)&c)|(a&(((((h&g)&f)&e)&c)|(d&((((h&g)&f)&c)|(e&(((h&g)&c)|(f&((g&c)|h)))))))))|(b&((((((h&g)&f)&d)&c)|(a&((((h&g)&d)&c)|(f&((h&g)|(d&(h|g)))))))|(e&((((h&g)&f)|(d&((h&g)|(f&(h|g)))))|(a&(((h&g)|(f&(h|g)))|(d&((h|g)|f))))))))) Yes (((((((e|c)&h)&b)|(f&(((e|c)&b)|h)))|(d&((((e|...
result:
ok 16384 lines, tightest: 115 out of 138 (16384 test cases)
Test #19:
score: 0
Accepted
time: 103ms
memory: 3840kb
input:
4096 9 00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000111000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000001000101110000000000000000000000010001011100000...
output:
Yes ((((((((h&g)&d)&b)&a)|(c&((((h&g)&b)&a)|(d&((g&b)|(a&(g|b)))))))&f)&e)|(i&((((((g&d)&c)&b)|(a&(((g&d)&c)|(b&((g&d)|(c&(g|d)))))))&f)|(e&(((((g&d)&b)|(a&((g&d)|(b&(g|d)))))|(c&(((g&b)|(a&(g|b)))|(d&(((h|g)|b)|a)))))|(f&(((((h&g)|d)|c)|b)|a))))))) Yes ((((((((i&g)&f)&d)&b)|(e&(((g&d)&b)|(i&(((g|f)...
result:
ok 4096 lines, tightest: 215 out of 266 (4096 test cases)
Test #20:
score: 0
Accepted
time: 54ms
memory: 3968kb
input:
1024 10 0000000000000000000000000000000100000000000000110000000000000011000000000000000100000000000000110000000000000011000000010000001100000000000000110000000000000011000000000000001100000011000001110000000000000011000000000000001100000011000001110000001100011111000000000000001100000000000000110000...
output:
Yes (((((((((h&g)&e)&a)|(i&(((e|a)&h)|(g&((h|e)|a)))))&f)&d)&b)|(j&((((((h&g)&e)|(i&(((e&a)|h)|g)))&f)&d)|(b&((((((i&h)&g)&e)&a)|(f&((((g&e)|(a&(g|e)))&h)|(i&((h|g)|e)))))|(d&(((((h&g)|(e&(h|g)))|(a&((h|g)|e)))|i)|f)))))))|(c&((((((((i&h)&g)&e)&a)|(f&((((g&e)|(a&(g|e)))&h)|(i&(((h|g)|e)|a)))))&d)|(b...
result:
ok 1024 lines, tightest: 324 out of 522 (1024 test cases)
Test #21:
score: 0
Accepted
time: 28ms
memory: 4096kb
input:
256 11 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...
output:
Yes (((((((((k&e)&d)&c)&a)|(b&(((((k&g)&e)&a)|(d&((k&a)|(e&((k|g)|a)))))|(c&((((k|g)|e)|d)|a)))))&i)&h)&f)|(j&(((((((((k&g)&e)&d)&c)&b)&a)|(i&((((k&e)&d)&c)|(b&((((k&e)&a)|(d&(k|e)))|c)))))&h)|(f&(((((((k&e)&d)&c)&b)&a)|(i&((((k&e)&d)&c)|(b&(((((g|a)&k)&e)|(d&(((g&a)|k)|e)))|c)))))|(h&(((((((k&g)&a)...
result:
ok 256 lines, tightest: 590 out of 1034 (256 test cases)
Test #22:
score: 0
Accepted
time: 15ms
memory: 4096kb
input:
64 12 000101011111111101111111111111110001011111111111011111111111111100010111111111110111111111111111000101111111111101111111111111110001010111111111011111111111111100010111111111110111111111111111000101111111111101111111111111110001011111111111111111111111111101111111111111111111111111111111011111...
output:
Yes (((((((((((h&g)&f)|j)&l)|(b&(((l|j)|g)|f)))&c)|(a&((((((h&g)|j)|f)&l)|c)|b)))|(i&(((((((h|g)&j)&f)|l)|c)|b)|a)))|(e&((((((((h&g)&f)|l)|j)|i)|c)|b)|a)))|(k&(((((((((h&g)|l)|j)|i)|f)|e)|c)|b)|a)))|d) Yes ((((((((((l&j)&i)&f)&d)&c)&b)&a)|(g&(((((((l|d)&j)&i)&c)&b)&a)|(f&(((((((l&k)&d)|(i&(l|d)))&j)...
result:
ok 64 lines, tightest: 1160 out of 2058 (64 test cases)
Test #23:
score: 0
Accepted
time: 8ms
memory: 3968kb
input:
16 13 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000011111111111111111111111111111100000000000000000000000000000000000000...
output:
Yes ((((((((((((m&l)&k)&d)&a)|(b&(((m&l)&k)|(d&((m&l)|(k&(m|l)))))))&e)&c)|(i&((((((m&l)&k)&d)&c)|(b&((((m&l)&k)&d)|(c&((((k|a)&m)&l)|(d&(((k&a)|m)|l)))))))|(e&((((((m&l)&k)&a)|(d&((m&l)|(k&(m|l)))))|(b&(((m&l)|(k&(m|l)))|(d&((m|l)|k)))))|(c&((((m&k)|(l&((m|k)|a)))|(d&(((m|l)|k)|a)))|b)))))))&g)&f)|...
result:
ok 16 lines, tightest: 1504 out of 4106 (16 test cases)
Test #24:
score: 0
Accepted
time: 4ms
memory: 3968kb
input:
4 14 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...
output:
Yes (((((((((((n&m)&h)&e)&c)&b)&a)|(k&(((((m&h)&e)&c)&a)|(b&((((m&h)&c)&a)|(e&(((h&c)&a)|(m&((((n&g)&a)|(h&(n|a)))|c)))))))))&j)&i)|(l&((((((((((n&g)|a)&m)&k)&h)&e)&c)&b)|(j&((((((h|a)&m)&e)&c)&b)|(k&((((((((g|d)&n)|h)|a)&m)&e)&c)|(b&(((((n|h)|a)&m)&e)|(c&((((n|h)|a)&m)|(e&(((n|m)|h)|a)))))))))))|(i...
result:
ok 4 lines, tightest: 1759 out of 8202 (4 test cases)
Test #25:
score: 0
Accepted
time: 4ms
memory: 3968kb
input:
4 14 0000000000000000000000000000000000000000000000000001000100010101000000000000000101010101010101010001010101010101011101110111111100000000000000000000000000000001000000000000000000010101010101010000000100010001010101010101011101010101010101010111111111111111000000000000000000010101010101010000000...
output:
Yes (((((((((((((m&h)|l)&n)&k)&j)&f)&d)&c)&b)|(i&((((((((l|h)&n)&k)&j)&d)&c)&b)|(f&(((((((l|h)&k)&j)&d)&c)&b)|(n&(((((((m|h)&l)&k)&d)&c)|(j&((((l|h)&k)&d)|(c&(((l|h)&k)|(d&((l|k)|h)))))))|(b&(((((l|h)&k)&d)|(c&(((l|h)&k)|(d&((l|k)|h)))))|(j&(((((m|l)|h)&k)|(d&(((m|l)|k)|h)))|(c&((((m|l)|k)|h)|d)))))...
result:
ok 4 lines, tightest: 1147 out of 8202 (4 test cases)
Test #26:
score: 0
Accepted
time: 5ms
memory: 3712kb
input:
4 14 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...
output:
Yes (((((((((((m&j)&h)&g)&f)&d)&b)|(e&((((((m&j)&h)|(f&((m&h)|(j&(((k&a)|m)|h)))))&g)&b)|(d&(((((((k&a)|h)&m)&j)|(f&(((k|h)&m)|j)))&g)|(b&(((((k|h)&m)&j)|(f&((((k|h)|a)&m)|j)))|(g&(((m|j)|h)|f)))))))))&n)&i)&c)|(l&((((((((((m&j)&i)&h)&g)&f)&e)&d)&b)|(c&(((((((m&j)&g)&f)&e)&d)&b)|(i&(((((((m&j)&h)|(f...
result:
ok 4 lines, tightest: 3117 out of 8202 (4 test cases)
Test #27:
score: 0
Accepted
time: 5ms
memory: 3968kb
input:
4 14 0000000000000000000000000001001100000000000000110000000000110011000000000011001100000000001100110000000000110011000000000011001100000000001100110000000000110011000000000011001100000000001100110001001100111111001100111111111100110011111111110011001111111111000000000011001100000011001101110000000...
output:
Yes (((((((((((((j&f)&c)&a)|(e&(((j&f)|(c&(j|f)))|(a&((j|f)|c)))))&m)&k)&h)&g)|(l&((((((((j&f)&e)&c)&a)|(k&(((j&f)&c)|(e&(((j&c)|(a&(j|c)))|f)))))&m)&g)|(h&((((((k&j)&f)&e)&c)|(m&(((((j&c)|(a&(j|c)))&f)&e)|(k&((((j&c)&a)|(f&(j|c)))|(e&(((j|f)|c)|a)))))))|(g&(((((j&f)&c)|(e&(((j&c)|(a&(j|c)))|f)))|(m...
result:
ok 4 lines, tightest: 1573 out of 8202 (4 test cases)
Test #28:
score: 0
Accepted
time: 5ms
memory: 3968kb
input:
4 14 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000001000000000000000000000000000000000000000...
output:
Yes (((((((((((((n&h)&g)&f)&e)|(m&(((n&h)&f)|(g&(((n&h)|(e&(n|h)))|f)))))&l)&k)&i)&d)&a)|(c&((((((((((n&m)&l)&i)&h)&g)&f)&e)|(k&((((((n&m)&i)&h)&g)&f)|(l&((((((n|e)&m)&h)&g)&f)|(i&(((((n&e)|h)&g)&f)|(m&(((n|h)&f)|g)))))))))&a)|(d&((((((m&l)&k)&g)&f)|(i&((((m&l)&g)&f)|(k&(((m&g)&f)|(l&(((((n&h)&e)|f)...
result:
ok 4 lines, tightest: 2042 out of 8202 (4 test cases)
Test #29:
score: 0
Accepted
time: 2ms
memory: 3840kb
input:
1 15 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...
output:
Yes ((((((((((((((o&n)&m)&l)&k)&j)&i)&g)&f)&e)&d)&c)&b)|(h&(((((((((((o&n)&m)&l)&k)&j)&i)&f)&e)&c)&b)|(d&((((((((((o&n)&m)&l)&k)&j)&i)&e)&c)&b)|(f&(((((((((n&m)&l)&k)&j)&i)&e)&c)&b)|(o&(((((((((m|g)&n)&l)&k)&j)&i)&e)&b)|(c&((((((((m|g)&l)&k)&j)&i)&e)&b)|(n&(((((((m&k)&g)|(j&((m&g)|k)))&l)&i)&b)|(e&(...
result:
ok 1 lines, tightest: 635 out of 16394 (1 test case)
Test #30:
score: 0
Accepted
time: 2ms
memory: 3968kb
input:
1 15 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...
output:
Yes (((((((((((((n&m)&l)&k)&i)&g)&f)&d)&c)&b)|(j&(((((((((k|b)&n)&m)&l)&i)&g)&f)&c)|(d&(((((((((k&b)&a)|(g&(k|b)))&n)&m)&l)&i)&f)|(c&((((((((k&b)&a)|(g&(k|b)))&n)&m)&l)&f)|(i&((((((k&g)|(b&(k|g)))&n)&l)&f)|(m&((((((k&g)&b)&a)|f)&n)|(l&((((k&g)&b)|n)|f)))))))))))))|(e&(((((((((g|b)&n)&m)&l)&i)&f)&d)|...
result:
ok 1 lines, tightest: 1606 out of 16394 (1 test case)
Test #31:
score: 0
Accepted
time: 2ms
memory: 3968kb
input:
1 15 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000...
output:
Yes (((((((((((((m&l)&k)&j)&g)&f)&a)|(i&((((((m&l)&k)&g)&f)&a)|(j&(((((l&k)&g)&f)&a)|(m&(((((l|d)&k)&g)&f)|(a&((((l|d)&k)&g)|(f&(((l|d)&k)|g)))))))))))&o)&n)|(h&(((((((((m&l)&k)&j)&g)&f)&a)|(i&((((((m&l)&k)&g)&f)&a)|(j&(((((l&k)&g)&f)&a)|(m&(((((l|d)&k)&g)&f)|(a&((((l|d)&k)&g)|(f&(((l|d)&k)|g)))))))...
result:
ok 1 lines, tightest: 3667 out of 16394 (1 test case)
Test #32:
score: 0
Accepted
time: 2ms
memory: 3968kb
input:
1 15 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000001100000000000000110000001100111111000000000000000000000000000000000000000...
output:
Yes ((((((((((((n&m)&l)&j)&g)&f)&d)&b)|(k&(((((((m&l)&j)&g)&f)&d)&b)|(n&(((((((j|a)&m)&l)&g)&f)&d)|(b&((((((j|a)&m)&l)&g)&f)|(d&((((((o|j)|a)&m)&l)&g)|(f&(((((o|j)|a)&m)&l)|(g&((((o&j)&a)|m)|l)))))))))))))|(c&(((((((((j|a)&m)&l)&g)&f)&d)&b)|(k&((((((((o&j)&a)|(m&((o|j)|a)))&l)&g)&f)&b)|(d&(((((((o&j...
result:
ok 1 lines, tightest: 2854 out of 16394 (1 test case)
Test #33:
score: 0
Accepted
time: 2ms
memory: 3968kb
input:
1 15 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...
output:
Yes ((((((((((((((n&j)|(g&(n|j)))&l)|(c&(((n&j)|(g&(n|j)))|l)))&m)&k)&i)&h)&f)&e)&b)&a)|(d&((((((((((((n&m)&l)&j)&g)&c)|(i&(((((n&l)&j)&g)&c)|(m&((((n&j)|(g&(n|j)))&l)|(c&(((j&g)|n)|l)))))))&k)&f)&e)&b)&a)|(h&(((((((((((n&m)&l)&k)&j)&i)&g)&e)&c)&b)|(a&(((((((((j|g)&n)&m)&l)&k)&i)&c)&b)|(e&((((((((j|...
result:
ok 1 lines, tightest: 1516 out of 16394 (1 test case)
Test #34:
score: 0
Accepted
time: 2ms
memory: 3968kb
input:
1 15 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001010100000000000000000000000001010101000000000000000000000000000000000000000...
output:
Yes ((((((((((((((o&l)|(c&(o|l)))|(b&((o|l)|c)))&m)&j)&i)&g)&f)&d)|(e&(((((((((o&l)|(c&(o|l)))|(b&((o|l)|c)))&j)&i)&g)&f)&d)|(m&((((((((o&l)&c)&b)|(f&(((o&l)|(c&(o|l)))|(b&((o|l)|c)))))&j)&i)&g)|(d&(((((((o&l)&c)&b)|(f&(((o&l)|(c&(o|l)))|(b&((o|l)|c)))))&j)&g)|(i&(((((o&l)&b)|(f&(((o|l)|c)|b)))&j)|(...
result:
ok 1 lines, tightest: 2839 out of 16394 (1 test case)
Test #35:
score: 0
Accepted
time: 588ms
memory: 3840kb
input:
65536 7 00000000000000010000000100000101000000000001011100000101010111110000000100000001000001110001011100000101001101110011011111111111 7 00000000000000010000000000010111000000000000011100000001011111110000000100000001000000110011011100010101001101110011111111111111 7 000000000000000000000001000100...
output:
Yes ((((((g&e)&d)&b)&a)|(f&(((g&e)&b)|(d&(((e|b)&g)|(a&(e|b)))))))|(c&((((f&e)&d)|(b&((g&e)|(d&((g&e)|f)))))|(a&((((g|d)&f)|(b&(g|d)))|(e&(((g|f)|d)|b))))))) Yes ((((((f&e)&c)&b)&a)|(g&((((e|a)&f)&c)|(b&(((f|c)&e)|(a&(f|c)))))))|(d&((((f&c)&a)|(b&((g&f)|(c&(f|a)))))|(e&(((c&a)|(f&((g|c)|a)))|(b&(((g...
result:
ok 65536 lines, tightest: 52 out of 74 (65536 test cases)
Test #36:
score: 0
Accepted
time: 119ms
memory: 3840kb
input:
1024 10 0000000000000000000000000000000000000000000000000000000000000011000000000000000000000001000001110000000000000111000101010111011100000000000000000000000000000111000000010001011100010011000101110000000100000001000001110001011100000101011111110101111111111111000000000000000100000000000100010000...
output:
Yes ((((((((j&i)&g)&d)&a)|(c&((((j&i)&g)&d)|(b&((((j|d)&i)&a)|(g&((i&d)|(j&((i|d)|a)))))))))|(h&((((((j&i)&g)&c)&b)|(d&((((i|g)&j)&c)|(b&((j&c)|(i&((j|g)|c)))))))|(a&((((j&d)&b)|(i&((j&d)|(c&(j|b)))))|(g&(((j&d)|(c&(j|b)))|(i&(((j|d)|c)|b)))))))))|(e&(((((((j|c)&i)&g)&b)|(a&(((j&i)&g)|(c&((j&i)|(b&(...
result:
ok 1024 lines, tightest: 289 out of 522 (1024 test cases)
Test #37:
score: 0
Accepted
time: 36ms
memory: 4096kb
input:
64 12 000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000001000101110000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000010000000100010101000101110111111100000000000000000000000000000001000000...
output:
Yes (((((((((((l&k)&j)&i)&h)&f)&d)|(e&(((((l&k)&i)&h)&f)|(d&((((k&j)&i)&h)|(f&(((l&j)&i)|(h&((k&i)|(j&((l|k)|i)))))))))))|(c&(((((((i|h)&l)&k)&j)&f)|(e&((((l&j)&h)&f)|(i&((((k|h)&l)&j)|(f&((k&j)|(h&(l|k)))))))))|(d&(((((l&k)&j)&f)|(e&(((l&k)&i)|(j&((l&k)|(f&(l|k)))))))|(h&((((k&j)&e)|(f&((l&e)|(k&((...
result:
ok 64 lines, tightest: 1025 out of 2058 (64 test cases)
Test #38:
score: 0
Accepted
time: 33ms
memory: 3968kb
input:
64 12 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000...
output:
Yes ((((((((((k&j)&i)&f)&e)&c)&b)|(g&((((((l&k)&j)&f)&c)&b)|(i&((((((l|b)&k)&j)&f)&e)|(c&(((((l|k)&j)&f)&e)|(b&((((l|j)&k)&e)|(f&((k&j)|(l&((k|j)|e)))))))))))))|(d&(((((((j&i)&g)&e)&c)&b)|(k&((((((j|g)&l)&i)&e)&c)|(b&(((((e|c)&l)&i)&g)|(j&((((l|i)&g)&e)|(c&((i&e)|(l&((i|g)|e)))))))))))|(f&((((((l&k)...
result:
ok 64 lines, tightest: 904 out of 2058 (64 test cases)
Test #39:
score: 0
Accepted
time: 24ms
memory: 3968kb
input:
64 12 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000...
output:
Yes ((((((((((j&i)&h)&g)&f)&e)&c)&b)|(k&((((((((l|i)&j)&h)&g)&f)&e)&c)|(b&((((((l&j)&h)&g)&f)&e)|(i&((((((j|c)&l)&h)&g)&e)|(f&((((h&g)&e)&c)|(j&(((h&e)&c)|(l&((h&c)|(g&((h|e)|c)))))))))))))))|(a&(((((((((j|f)&l)&i)&h)&g)&c)&b)|(e&((((((l&j)&i)&h)&g)&c)|(f&((((((g|c)&l)&j)&i)&h)|(b&(((((l|j)&i)&h)&g)...
result:
ok 64 lines, tightest: 627 out of 2058 (64 test cases)
Test #40:
score: 0
Accepted
time: 10ms
memory: 3840kb
input:
4 14 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000010111000000000000000000000000000000000000000...
output:
Yes (((((((((((((l&k)&h)&g)&e)&d)&c)&a)|(n&(((((((c|a)&l)&k)&h)&g)&e)|(d&((((((h|e)&l)&k)&g)&a)|(c&((((l&g)&e)&a)|(h&(((g&e)&a)|(k&((g&e)|(l&((g|e)|a)))))))))))))|(j&((((((((n&l)&k)&h)&g)&c)&a)|(d&(((((n&l)&k)&c)&a)|(g&(((((l|k)&n)&h)&c)|(a&(((n&l)&c)|(k&((n&c)|(h&((n|l)|c)))))))))))|(e&(((((((n&k)&...
result:
ok 4 lines, tightest: 3770 out of 8202 (4 test cases)
Test #41:
score: 0
Accepted
time: 10ms
memory: 3968kb
input:
4 14 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000...
output:
Yes (((((((((((((n&m)&l)&k)&h)&g)&d)&c)&b)|(i&(((((((n&l)&k)&h)&g)&d)&c)|(b&((((((n&m)&l)&k)&h)&d)|(g&(((((n&m)&k)&h)&d)|(c&((((n&k)&h)&d)|(m&((((n|l)&k)&d)|(h&((l&k)|(n&((l|k)|d)))))))))))))))|(f&(((((((((g|d)&n)&m)&l)&i)&h)&b)|(c&(((((((n|i)&m)&l)&h)&g)&b)|(d&((((((h|g)&n)&m)&l)&b)|(i&(((((m|b)&n)...
result:
ok 4 lines, tightest: 3346 out of 8202 (4 test cases)
Test #42:
score: 0
Accepted
time: 5ms
memory: 3968kb
input:
1 15 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000100000001000000000000000000000000000000000000000...
output:
Yes (((((((((((((o&n)&k)&h)&f)&e)&b)|(d&((((((o&k)&h)&g)&f)&b)|(e&(((((o&n)&g)&f)&b)|(k&((((n&h)&g)&b)|(o&((((h|b)&n)&g)|(f&((n&g)|(h&((n|g)|b)))))))))))))|(l&(((((((o&n)&g)&e)&d)&b)|(f&(((((o&k)&g)&e)&d)|(n&(((((g|e)&o)&k)&d)|(b&((((k|e)&o)&g)|(d&((o&k)|(e&(k|g)))))))))))|(h&(((((((k&g)&f)&e)&d)&b)...
result:
ok 1 lines, tightest: 7100 out of 16394 (1 test case)
Test #43:
score: 0
Accepted
time: 7ms
memory: 3968kb
input:
1 15 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...
output:
Yes ((((((((((((((n&m)&l)&k)&i)&g)&f)&d)&c)|(h&(((((((n&m)&l)&k)&i)&g)&c)|(f&(((((((i|c)&n)&m)&k)&g)&d)|(l&((((((n|g)&m)&k)&i)&d)|(c&(((((g|d)&n)&m)&k)|(i&((((n|g)&m)&k)|(d&((n&m)|(g&((n|m)|k)))))))))))))))|(e&((((((((n&m)&l)&k)&i)&h)&f)|(d&((((((n&m)&l)&k)&h)&c)|(f&(((((n&m)&k)&i)&c)|(h&((((m&l)&k)...
result:
ok 1 lines, tightest: 7079 out of 16394 (1 test case)
Test #44:
score: 0
Accepted
time: 6ms
memory: 3968kb
input:
1 15 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...
output:
Yes ((((((((((((((d|b)&o)&n)&m)&l)&j)&i)&h)&g)|(a&(((((((((m|l)&o)&n)&j)&i)&h)&g)&b)|(d&((((((((m|i)&o)&n)&l)&j)&h)&b)|(g&(((((((n|m)&o)&l)&j)&i)&b)|(h&(((((o&n)&j)&i)&b)|(m&((((o&j)&i)&b)|(n&((((j|b)&o)&l)|(i&(((o|l)&j)|(b&((o|l)|j)))))))))))))))))|(f&((((((((((n|g)&o)&l)&j)&i)&h)&b)&a)|(d&(((((((o...
result:
ok 1 lines, tightest: 5657 out of 16394 (1 test case)
Extra Test:
score: 0
Extra Test Passed