Submission #587069

#TimeUsernameProblemLanguageResultExecution timeMemory
587069FatihSolakCave (IOI13_cave)C++17
51 / 100
2075 ms876 KiB
#include "cave.h" #include <bits/stdc++.h> #define N 5000 using namespace std; int get(int s[]){ int ret = tryCombination(s); if(ret == -1)ret = 1e9; return ret; } void exploreCave(int n) { int s[n],d[n]; set<int> rem; for(int i = 0;i<n;i++){ s[i] = 0; d[i] = -1; rem.insert(i); } for(int i = 0;i<n;i++){ bool val = get(s) > i; set<int> tmp = rem; while(tmp.size() > 1){ set<int> a; while(a.size() < tmp.size()){ a.insert(*tmp.begin()); tmp.erase(*tmp.begin()); } for(auto u:a){ s[u] = 1; } if( (get(s) > i) != val){ tmp = a; } for(auto u:a){ s[u] = 0; } } rem.erase(*tmp.begin()); d[*tmp.begin()] = i; s[*tmp.begin()] = !val; } answer(s,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...