Submission #401745

#TimeUsernameProblemLanguageResultExecution timeMemory
401745peuchUnscrambling a Messy Bug (IOI16_messy)C++17
38 / 100
2 ms332 KiB
#include "messy.h" #include<bits/stdc++.h> using namespace std; std::vector<int> restore_permutation(int n, int w, int r) { string aux(n, '0'); for(int i = 0; i < n; i++){ aux[i] = '1'; // cout << "Adding: " << aux << "\n"; add_element(aux); } compile_set(); vector<int> marc(n, 0); vector<int> p(n, 0); aux = string(n, '0'); int last = n - 1; for(int i = 0; i < n; i++){ int id = last; for(int j = 0; j < last; j++){ if(marc[j]) continue; aux[j] = '1'; // cout << "Checking: " << aux << "\n"; if(!check_element(aux)) { aux[j] = '0'; continue; } id = j; break; } marc[id] = 1; aux[id] = '1'; p[id] = i; if(id == last) last--; // cout << aux << " " << check_element(aux) << "\n"; } return p; }
#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...