Submission #829913

#TimeUsernameProblemLanguageResultExecution timeMemory
829913LiudasUnscrambling a Messy Bug (IOI16_messy)C++17
38 / 100
1 ms340 KiB
#include <vector> #include <cstdio> #include <string> #include <set> #include <cstdlib> #include <iostream> #include "messy.h" #include <numeric> #include <algorithm> #include <random> using namespace std; vector<int> restore_permutation(int N, int W, int R){ string s = string(N, '0'); for(int i = 0; i < N; i ++){ s[i] = '1'; add_element(s); } vector<int> order(N); iota(order.begin(), order.end(), 0); compile_set(); string ans = string(N, '0'); vector<int> perm(N); for(int i = 0; i < N; i ++){ shuffle(order.begin(), order.end(), mt19937(1e9+9)); for(int j : order){ string temp = ans; if(ans[j] == '0'){ temp[j] = '1'; bool good = check_element(temp); if(good){ ans[j] = '1'; perm[j] = i; break; } } } } return perm; }
#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...