Submission #287921

#TimeUsernameProblemLanguageResultExecution timeMemory
287921dantoh000"The Lyuboyn" code (IZhO19_lyuboyn)C++14
19 / 100
646 ms5304 KiB
#include <bits/stdc++.h> using namespace std; int n,k,t; string s; string bin(int x){ string ret = ""; for (int i = n-1; i >= 0; i--){ if (x>>i&1){ ret+="1"; } else ret +="0"; } return ret; } int main() { scanf("%d%d%d",&n,&k,&t); cin >> s; if (k == 1){ printf("%d\n",(1<<n)); for (int i = 0; i < (1<<n); i++){ cout << bin(i^(i>>1)) << endl; } } else if (k%2 == 0){ printf("-1\n"); } else if (k == 3){ printf("%d\n",(1<<n)); for (int i = 0; i < (1<<n); i++){ int ans = i^(i>>1); if (i&1) ans ^= ((1<<n)-1); cout << bin(ans) << endl; } } }

Compilation message (stderr)

lyuboyn.cpp: In function 'int main()':
lyuboyn.cpp:17:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   17 |     scanf("%d%d%d",&n,&k,&t);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~
#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...