Submission #830044

#TimeUsernameProblemLanguageResultExecution timeMemory
830044LiudasUnscrambling a Messy Bug (IOI16_messy)C++17
49 / 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> #include <chrono> 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); shuffle(order.begin(), order.end(), mt19937(97)); for(int i = 0; i < N; i ++){ 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...