# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
681614 | Karuk | "The Lyuboyn" code (IZhO19_lyuboyn) | C++14 | 1083 ms | 23216 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.
#include<bits/stdc++.h>
using namespace std;
int main() {
int n,k,t;cin>>n>>k>>t;
string s;cin>>s;
if(k%2==0){cout<<-1;return 0;}
if(t==1) {
deque<string>v;
vector<int>st;
st.push_back(0);
for(int i=1;i<n;i++) {
vector<int>t=st;
reverse(t.begin(),t.end());
st.push_back(i);
for(int j:t)st.push_back(j);
}
string cur;
for(int i=0;i<n;i++)cur+='0';
v.push_back(cur);
for(int i=0;i<st.size();i++) {
int ind=st[i];
for(int q=0;q<k;q++) {
if(cur[ind]=='0')cur[ind]='1';
else cur[ind]='0';
ind--;
if(ind<0)ind+=n;
}
v.push_back(cur);
}
while(v.front()!=s){v.push_back(v.front());v.pop_front();}
cout<<(1<<n)<<endl;
for(string ss:v)cout<<ss<<endl;
} else {
cout<<-1;return 0;
}
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... |