Submission #1074274

#TimeUsernameProblemLanguageResultExecution timeMemory
1074274clementineUnscrambling a Messy Bug (IOI16_messy)C++17
38 / 100
1 ms600 KiB
#include "messy.h" #include <bits/stdc++.h> using namespace std; int p[35]; std::vector<int> restore_permutation(int n, int w, int r) { vector<int> ans(n, 0); for(int i = 1; i <= n; i ++) { string s = ""; for(int j = 1; j <=i; j ++) { s += "1"; } for(int j = i + 1; j <=n; j ++) { s += "0"; } //cout << s << '\n'; add_element(s); } compile_set(); string s = ""; for(int i =1; i <=n; i ++) { s += "0"; } for(int i = 0; i <n; i ++) { for(int idx = 0; idx<n; idx ++) { if(s[idx] == '0') { string a = s; a[idx] = '1'; //cout << a << '\n'; if(check_element(a)) { ans[idx] = i; s[idx] = '1'; break; } } } } /* for(auto a : ans) { cout << a << '\n'; }*/ return ans; }
#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...