제출 #393003

#제출 시각아이디문제언어결과실행 시간메모리
393003patrikpavic2"The Lyuboyn" code (IZhO19_lyuboyn)C++17
100 / 100
391 ms6328 KiB
#include <cstdio> #include <cstdlib> using namespace std; const int N = 20; const int MSK = (1 << N); int n, k, bla, bs[N], bio[MSK]; int main(){ scanf("%d%d%d", &n, &k, &bla); int poc = 0; for(int i = 0;i < n;i++){ char c; scanf(" %c", &c); poc += (c & 1) << i; } if(!(k & 1)){ printf("-1\n"); return 0; } int sz = 0; bio[0] = 1; for(int x = 0;x < (1 << n);x++){ if(bio[x] || __builtin_popcount(x) != k) continue; bs[sz++] = x; for(int y = 0;y < (1 << n);y++) bio[x ^ y] |= bio[y]; } printf("%d\n", (1 << n)); for(int i = 0;i < (1 << n);i++){ int cur = poc; for(int j = 0;j < n;j++) if((i ^ (i >> 1)) & (1 << j)) cur ^= bs[j]; for(int j = 0;j < n;j++) printf("%c", 48 + ((cur >> j) & 1)); printf("\n"); } return 0; }

컴파일 시 표준 에러 (stderr) 메시지

lyuboyn.cpp: In function 'int main()':
lyuboyn.cpp:12:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   12 |  scanf("%d%d%d", &n, &k, &bla);
      |  ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
lyuboyn.cpp:15:16: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   15 |   char c; scanf(" %c", &c);
      |           ~~~~~^~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...