# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
770027 | rainboy | "The Lyuboyn" code (IZhO19_lyuboyn) | C11 | 304 ms | 5304 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <stdio.h>
#define N 18
int count(int b) {
return b == 0 ? 0 : count(b & b - 1) + 1;
}
int bb_[N], n;
int add(int b) {
int i;
for (i = 0; i < n; i++)
if (b & 1 << i) {
if (bb_[i] & 1 << i)
b ^= bb_[i];
else {
bb_[i] = b;
return 1;
}
}
return 0;
}
int main() {
static char cc[N + 1];
static int bb[N];
int m, k, i, b, b_, x, x_;
scanf("%d%d%*d%s", &n, &k, cc);
x = 0;
for (i = 0; i < n; i++)
if (cc[i] == '1')
x |= 1 << i;
m = 0;
for (b = 0; b < 1 << n; b++)
if (count(b) == k && add(b))
bb[m++] = b;
if (m < n) {
printf("-1\n");
return 0;
}
printf("%d\n", 1 << n);
for (b = 0; b < 1 << n; b++) {
b_ = b ^ b >> 1;
x_ = x;
for (i = 0; i < n; i++)
if ((b_ & 1 << i) != 0)
x_ ^= bb[i];
for (i = 0; i < n; i++)
printf("%d", x_ >> i & 1);
printf("\n");
}
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |