Submission #768032

#TimeUsernameProblemLanguageResultExecution timeMemory
7680321neUnscrambling a Messy Bug (IOI16_messy)C++14
0 / 100
1 ms340 KiB
#include <vector> #include "messy.h" #include <bits/stdc++.h> using namespace std; std::vector<int> restore_permutation(int n, int w, int r) { string s; for (int i = 0;i<n;++i){ s+='0'; } for (int i = 0;i<n - 1;++i){ s[i] = '1'; add_element(s); } compile_set(); vector<int>pos(n,-1); string cur; for (int i = 0;i<n;++i){ cur+='0'; } vector<bool>visited(n,false); for (int i = 0;i<n - 1;++i){ for (int j = 0;j<n;++j){ if (visited[j])continue; cur[j] = '1'; if (check_element(cur)){ visited[j] = true; pos[i] = j + 1; break; } cur[j] = '0'; } } for (int i = 0;i<n;++i){ if (!visited[i]){ pos[n - 1] = i + 1; } } return pos; }
#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...