Submission #1232113

#TimeUsernameProblemLanguageResultExecution timeMemory
1232113clemmy14Cave (IOI13_cave)C++20
46 / 100
17 ms328 KiB
#include<bits/stdc++.h> #include "cave.h" using namespace std; void exploreCave(int N) { int comb[N], con[N]; for(int i=0; i<N; i++) { comb[i]=0; } vector<bool> defo(N, false); bool found=false; int cur=tryCombination(comb); for(int i=0; i<N; i++) { if(found) break; if(cur == -1) { found=true; break; } for(int j=0; j<N; j++) if(!defo[j]) { comb[j]=1-comb[j]; int now = tryCombination(comb); // for(auto x : comb) cout << x << ' '; // cout << endl; // cout << cur << ' ' << now << endl; if(cur == now) comb[j]=1-comb[j]; else if(cur < now) { defo[j]=true; con[j]=cur; cur=now; break; }else if(now == -1) { found=true; break; } else { defo[j]=true; con[j]=now; comb[j]=1-comb[j]; } } if(found) break; } for(int i=0; i<N; i++) if(!defo[i]) { comb[i]=1-comb[i]; int firstC=tryCombination(comb); con[i]=firstC; comb[i]=1-comb[i]; } answer(comb, con); }
#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...