# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
288206 | SomeoneUnknown | "The Lyuboyn" code (IZhO19_lyuboyn) | C++14 | 486 ms | 5496 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b){
if(b>a) return gcd(b,a);
if(b == 0) return a;
return gcd(b, a%b);
}
int main(){
int n, k, t;
scanf("%d %d %d", &n, &k, &t);
char s0[n+1];
scanf("%s", &s0);
bool s0b[n];
for(int i = 0; i < n; ++i){
s0b[i] = (s0[i] == '1');
}
if(/*gcd(n, k) != 1 ||*/ k%2 == 0){
printf("-1");
return 0;
}
printf("%d\n", 1 << n);
printf("%s", s0);
for(int i = 1; i < (1 << n); ++i){
printf("\n");
int sind = 0;
int ti = i;
while(ti % 2 == 0){
ti >>= 1;
sind++;
}
s0b[(sind + k) % n] = !s0b[(sind + k) % n];
s0b[(sind + k-1) % n] = !s0b[(sind + k-1) % n];
for(int j = sind; j != (sind + k) % n; j = (j+1) % n){
s0b[j] = !s0b[j];
}
for(int j = 0; j < n; ++j){
printf("%d", s0b[j]);
}
}
}
컴파일 시 표준 에러 (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... |