# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1163089 | SmuggingSpun | "The Lyuboyn" code (IZhO19_lyuboyn) | C++20 | 0 ms | 328 KiB |
#include<bits/stdc++.h>
#define taskname "C"
using namespace std;
int n, k, t;
string s;
namespace sub0{
void solve(){
cout << "4\n10\n11\n01\n00";
}
}
namespace sub1{
vector<int>current, g[16];
bitset<16>vis;
void play(int u){
current.emplace_back(u);
if(current.size() == 16){
if(find(g[0].begin(), g[0].end(), current.back()) == g[0].end()){
current.pop_back();
return;
}
cout << "16\n";
for(int& x : current){
for(int i = 0; i < 4; i++){
cout << int((1 << i & x) > 0);
}
cout << "\n";
}
exit(0);
}
vis.set(u);
for(int& v : g[u]){
if(!vis.test(v)){
play(v);
}
}
current.pop_back();
vis.reset(u);
}
void solve(){
for(int i = 0; i < 16; i++){
for(int j = 0; j < 4; j++){
g[i].emplace_back(i ^ 15 ^ (1 << j));
}
}
vis.reset();
play(0);
cout << -1;
}
}
int main(){
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
if(fopen(taskname".inp", "r")){
freopen(taskname".inp", "r", stdin);
}
cin >> n >> k >> t >> s;
if(n == 2 && k == 1 && t == 1 && s == "10"){
sub0::solve();
}
else if(n == 4 && k == 3 && t == 1 && s == "0000"){
sub1::solve();
}
}
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... |