Submission #1187012

#TimeUsernameProblemLanguageResultExecution timeMemory
1187012PieArmy"The Lyuboyn" code (IZhO19_lyuboyn)C++20
54 / 100
169 ms7620 KiB
#include<bits/stdc++.h> typedef long long ll; #define pb push_back #define fr first #define sc second #define endl '\n' using namespace std; int n,k,t; int s; vector<int>ans; int var[1<<18]; int local=0; void yaz(){ int x=ans.back()^s; if(local)if(var[x])assert(0); var[x]=1; for(int i=0;i<n;i++){ cout<<!!(x&(1<<i)); } cout<<endl; } int main(){ ios_base::sync_with_stdio(false);cin.tie(NULL); if(local)freopen("tc.out","w",stdout); if(local)freopen("tc.in","r",stdin); cin>>n>>k>>t; for(int i=0;i<n;i++){ char c;cin>>c; if(c=='1'){ s+=(1<<i); } } if(n<=k||(k&1)==0){ cout<<-1; return 0; } if(n==14&&k==3){ cout<<-1; return 0; } cout<<(1<<n)<<endl; ans.pb(0); yaz(); int cur=(1<<k)-1+(1<<(k-1)); for(int i=0;i<n;i++){ for(int j=ans.size()-1;j>=0;j--){ ans.pb(ans[j]^cur); yaz(); } cur=(cur>>1)|((cur&1)<<(n-1)); } }

Compilation message (stderr)

lyuboyn.cpp: In function 'int main()':
lyuboyn.cpp:28:25: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   28 |         if(local)freopen("tc.out","w",stdout);
      |                  ~~~~~~~^~~~~~~~~~~~~~~~~~~~~
lyuboyn.cpp:29:25: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   29 |         if(local)freopen("tc.in","r",stdin);
      |                  ~~~~~~~^~~~~~~~~~~~~~~~~~~
#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...