Submission #591930

#TimeUsernameProblemLanguageResultExecution timeMemory
591930VanillaUnscrambling a Messy Bug (IOI16_messy)C++17
38 / 100
1 ms340 KiB
#include <bits/stdc++.h> #include "messy.h" #include <vector> using namespace std; const int RANDOM = chrono::high_resolution_clock::now().time_since_epoch().count(); vector<int> restore_permutation(int n, int w, int r) { string s = ""; for (int i = 0; i < n; i++){ s.push_back('1'); } for (int i = 0; i < n; i++){ s[i] = '0'; add_element(s); } compile_set(); vector <int> frq(128); vector <int> p (n); s = ""; for (int i = 0; i < n; i++) { s.push_back('1'); } vector <int> v; for (int i = 0; i < n; i++){ v.push_back(i); } mt19937 rng(RANDOM); for (int i = 0; i < n; i++){ shuffle(v.begin(), v.end(), rng); for (int j: v){ if (s[j] == '1') { s[j] = '0'; if (check_element(s)) { p[j] = i; break; } s[j] = '1'; } } } 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...