Submission #303904

#TimeUsernameProblemLanguageResultExecution timeMemory
303904rocks03Cave (IOI13_cave)C++14
13 / 100
17 ms476 KiB
#include "cave.h" #include<bits/stdc++.h> using namespace std; void answer(int S[], int D[]); int tryCombination(int S[]); void exploreCave(int N){ int ans[N], d[N]; memset(ans, 0, sizeof(ans)); memset(d, -1, sizeof(d)); vector<bool> vis(N, false); vector<int> mn(N, 0); int res = tryCombination(ans); while(res != -1){ for(int i = 0; i < N; i++){ if(d[i] != -1 || mn[i] > res){ continue; } ans[i] ^= 1; int res2 = tryCombination(ans); if(res2 == -1){ res = res2; break; } if(res2 < res){ ans[i] ^= 1; d[i] = res2; } else if(res == res2){ mn[i] = res; continue; } else if(res > res2){ d[i] = res; res = res2; } } } for(int i = 0; i < N; i++){ if(d[i] == -1){ ans[i] ^= 1; d[i] = tryCombination(ans); ans[i] ^= 1; } } answer(ans, d); }
#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...