답안 #384409

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
384409 2021-04-01T15:43:50 Z patrikpavic2 "The Lyuboyn" code (IZhO19_lyuboyn) C++17
14 / 100
474 ms 5484 KB
#include <cstdio>

using namespace std;

int n, k, T, S;

int main(){	
	scanf("%d%d%d", &n, &k, &T);
	for(int i = 0;i < n;i++){
		char c; scanf(" %c", &c);
		S += (c - '0') * (1 << i);
	}
	if(n == 4 && k == 3 && S == 0 && T == 1){
		printf("0000\n0010\n0011\n0111\n1111\n1011\n1001\n0001\n0101\n1101\n1100\n1000\n1010\n1110\n0110\n0100\n");
		return 0;
	}
	if(k == 1){
		printf("%d\n", (1 << n));
		for(int i = 0;i < (1 << n);i++){
			int x = i ^ (i >> 1) ^ S;
			for(int j = 0;j < n;j++)
				printf("%d", !!(x & (1 << j)));
			printf("\n");
		}
	}
	if(k % 2 == 0){
		printf("-1\n");
	}
	return 0;
}

Compilation message

lyuboyn.cpp: In function 'int main()':
lyuboyn.cpp:8:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
    8 |  scanf("%d%d%d", &n, &k, &T);
      |  ~~~~~^~~~~~~~~~~~~~~~~~~~~~
lyuboyn.cpp:10:16: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   10 |   char c; scanf(" %c", &c);
      |           ~~~~~^~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 256 KB Ok
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 256 KB Expected integer, but "0000" found
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 256 KB Ok
2 Correct 1 ms 256 KB Ok
3 Correct 1 ms 256 KB Ok
4 Correct 1 ms 256 KB Ok
5 Correct 1 ms 256 KB Ok
6 Correct 1 ms 256 KB Ok
7 Correct 1 ms 364 KB Ok
8 Correct 1 ms 364 KB Ok
# 결과 실행 시간 메모리 Grader output
1 Correct 474 ms 5484 KB Ok
2 Correct 220 ms 2668 KB Ok
3 Correct 2 ms 364 KB Ok
4 Correct 1 ms 512 KB Ok
5 Correct 1 ms 256 KB Ok
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 256 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 256 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 474 ms 5484 KB Ok
2 Correct 220 ms 2668 KB Ok
3 Correct 2 ms 364 KB Ok
4 Correct 1 ms 512 KB Ok
5 Correct 1 ms 256 KB Ok
6 Incorrect 1 ms 256 KB Unexpected end of file - int32 expected
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 256 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -