Submission #384515

#TimeUsernameProblemLanguageResultExecution timeMemory
384515dorijanlendvaj"The Lyuboyn" code (IZhO19_lyuboyn)C++14
100 / 100
115 ms5380 KiB
#include <bits/stdc++.h> #define x first #define y second #define pii pair<int,int> using namespace std; using ll=long long; #define pll pair<ll,ll> #define vi vector<int> #define vl vector<ll> #define pb push_back #define eb emplace_back #define all(a) begin(a),end(a) const int N=300010,MOD=1e9+7; const char en='\n'; const ll LLINF=1ll<<60; int k,n,t; string s; void flip(vi v) { for (auto a: v) s[a]^=1; cout<<s<<en; } int main() { ios_base::sync_with_stdio(false); cin.tie(0); cin>>n>>k>>t>>s; if (k%2==0) { cout<<-1<<en; exit(0); } cout<<(1<<n)<<en<<s<<en; for (int i=0;i<(1<<(n-k-1));++i) { if (i) { vi v; v.pb(k+1+__builtin_ctz(i)); for (int j=0;j<k-1;++j) v.pb(j); flip(v); } for (int j=1;j<(1<<(k+1));++j) { int av=__builtin_ctz(j); vi v; for (int z=0;z<=k;++z) if (z!=av) v.pb(z); flip(v); } } }
#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...