# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
345864 | oleh1421 | "The Lyuboyn" code (IZhO19_lyuboyn) | C++17 | 266 ms | 7892 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
#define endl '\n'
const int N=1010;
const ll mod=1000000007;
void print(int x,int n){
for (int i=n-1;i>=0;i--){
cout<<(x>>i)%2;
}
cout<<endl;
}
void solve(){
int n,k,t;cin>>n>>k>>t;
string str;cin>>str;
int F0=0;
for (auto i:str){
F0*=2;
F0+=i-'0';
}
vector<int>basis;
vector<int>real_basis;
for (int i=0;i<(1<<n);i++){
if (__builtin_popcount(i)==k){
int x=i;
for (int y:basis){
x=min(x,x^y);
}
if (x) basis.push_back(x),real_basis.push_back(i);
}
}
if (basis.size()!=n){
cout<<-1<<endl;
return;
}
vector<int>pref;
for (int i=0;i<n;i++){
vector<int>nw=pref;
nw.push_back(real_basis[i]);
for (int x:pref) nw.push_back(x);
pref=nw;
}
print(F0,n);
for (int x:pref){
F0^=x;
print(F0,n);
}
}
int32_t main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
int tt=1;
while (tt--){
solve();
}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |