Submission #600896

#TimeUsernameProblemLanguageResultExecution timeMemory
600896SeDunionUnscrambling a Messy Bug (IOI16_messy)C++17
38 / 100
1 ms340 KiB
#include <iostream> #include <vector> #include "messy.h" using namespace std; vector<int> restore_permutation(int n, int w, int r) { for (int i = 1 ; i <= n ; ++ i) { string cur = ""; for (int _ = 0 ; _ < i ; ++ _) cur += "1"; for (int _ = 0 ; _ < n - i ; ++ _) cur += "0"; add_element(cur); } compile_set(); vector<int>p(n, -1); for (int i = 1 ; i <= n ; ++ i) { string cur(n, '0'); for (int j = 0 ; j < n ; ++ j) if (p[j] != -1) cur[j] = '1'; for (int j = 0 ; j < n ; ++ j) if (cur[j] == '0') { string temp = cur; temp[j] = '1'; if (check_element(temp)) { p[j] = i - 1; break; } } } 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...