Submission #830285

#TimeUsernameProblemLanguageResultExecution timeMemory
83028512345678Unscrambling a Messy Bug (IOI16_messy)C++17
20 / 100
1 ms340 KiB
#include "messy.h" #include <bits/stdc++.h> using namespace std; vector<int> restore_permutation(int n, int w, int r) { vector<int> ans(n); string s; for (int i=0; i<n; i++) s+='0', ans[i]=i; for (int i=0; i<n-1; i++) s[i]='1', add_element(s); for (int i=0; i<n; i++) s[i]='0'; compile_set(); for (int i=0; i<n-1; i++) { s[i]='1'; if (!check_element(s)) { s[i]='0'; for (int j=i+1; j<n; j++) { s[j]='1'; if (check_element(s)) { ans[j]=i, ans[i]=j; return ans; } } } } return ans; } /* 4 100 100 0 2 1 3 8 100 100 0 1 2 3 7 5 6 4 */
#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...