Submission #166543

#TimeUsernameProblemLanguageResultExecution timeMemory
166543NaimSSCave (IOI13_cave)C++14
0 / 100
321 ms512 KiB
#include "cave.h" #include <bits/stdc++.h> int S[5050]; int s[5050]; int con[5050]; void exploreCave(int N) { /* ... */ int n = N; for(int i=0;i<n;i++)S[i]=-1; int d=0; //tem ini caras que comecam com 0; int cur = 0; while(d<n){ for(int i=0;i<n;i++){ if(S[i]!=-1)s[i]=S[i]; else s[i] = 0; } int ini = tryCombination(s); while(cur<ini){ for(int i=0;i<n;i++){ if(S[i]!=-1)s[i] = S[i]; else s[i] = 0; } for(int i=0;i<n;i++){ s[i]=1; int x = tryCombination(s); if(x==cur){ con[cur] = i; S[i] = 0; d++; break; } s[i] = 0; } } //acho o 1 if(cur!=n){ for(int i=0;i<n;i++){ if(S[i]!=-1)s[i] = S[i]; else s[i] = 0; } for(int i=0;i<n;i++){ s[i]=1; int x = tryCombination(s); if(x>cur){ con[cur] = i; S[i] = 1; d++; break; } s[i] = 0; } } } answer(S,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...