Submission #959337

#TimeUsernameProblemLanguageResultExecution timeMemory
959337Darren0724"The Lyuboyn" code (IZhO19_lyuboyn)C++17
97 / 100
178 ms5968 KiB
#include <bits/stdc++.h> using namespace std; #define LCBorz ios_base::sync_with_stdio(false); cin.tie(0); #define int long long #define all(x) x.begin(), x.end() #define endl '\n' const int N=200005; const int INF=1e18; int32_t main() { LCBorz; int n,k,t;cin>>n>>k>>t; string str;cin>>str; int s=0; for(char c:str){ s=s<<1|(c&1); } vector<int> v(n+2); for(int i=0;i<=k;i++){ v[i]=(1<<k+1)-(1<<i)-1; //01110 //01101 //01011 //00111 //10011 } for(int i=k+1;i<n;i++){ v[i]=(1<<i)+(1<<k-1)-1; } cout<<(1<<n)<<endl; for(int i=1;i<=(1<<n);i++){ for(int j=n-1;j>=0;j--){ cout<<((s>>j)&1); } cout<<endl; int p=__lg(i&(-i)); s^=v[p]; } return 0; }

Compilation message (stderr)

lyuboyn.cpp: In function 'int32_t main()':
lyuboyn.cpp:20:19: warning: suggest parentheses around '+' inside '<<' [-Wparentheses]
   20 |         v[i]=(1<<k+1)-(1<<i)-1;
      |                  ~^~
lyuboyn.cpp:28:26: warning: suggest parentheses around '-' inside '<<' [-Wparentheses]
   28 |         v[i]=(1<<i)+(1<<k-1)-1;
      |                         ~^~
#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...