Submission #420980

#TimeUsernameProblemLanguageResultExecution timeMemory
420980temurbek_khujaevUnscrambling a Messy Bug (IOI16_messy)C++17
38 / 100
1 ms332 KiB
#include <vector> #include "messy.h" #include <bits/stdc++.h> using namespace std; string get_string(int n, int ones = 0) { return string(ones, '1') + string(n - ones, '0'); } std::vector<int> restore_permutation(int n, int w, int r) { vector<int> p(n, -1); for (int i = 0; i < n; i++) { add_element(get_string(n, i + 1)); } compile_set(); for (int i = 0; i < n; i++) { string s = get_string(n, i); string t = get_string(n,0); for (int j = 0; j < n; j++) { if (p[j] != -1) t[j] = s[p[j]]; } s = t; // cerr << s << endl; for (int j = 0; j < n; j++) { if (s[j] != '1' && p[j] == -1) { s[j] = '1'; // cerr << "\t" << s << endl; if (check_element(s)) { p[j] = i; // cerr << j << endl; break; } s[j] = '0'; } } } 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...