# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1163091 | SmuggingSpun | "The Lyuboyn" code (IZhO19_lyuboyn) | C++20 | 48 ms | 43336 KiB |
#include<bits/stdc++.h>
#define taskname "C"
using namespace std;
int n, k, t;
string s;
namespace sub1{
void solve(){
cout << "4\n10\n11\n01\n00";
}
}
namespace sub4{
vector<int>current, g[1 << 18];
bitset<1 << 18>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 < (1 << n); i++){
for(int j = 0; j < n; j++){
g[i].emplace_back(i ^ (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"){
sub1::solve();
}
else if(k == 1 && t == 1 && s == string(n, '0')){
sub4::solve();
}
}
컴파일 시 표준 에러 (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... |