Submission #709317

#TimeUsernameProblemLanguageResultExecution timeMemory
709317ssenseUnscrambling a Messy Bug (IOI16_messy)C++17
20 / 100
2 ms340 KiB
#include <bits/stdc++.h> #include "messy.h" #define startt ios_base::sync_with_stdio(false);cin.tie(0); typedef long long ll; using namespace std; #define vint vector<int> vector<int> restore_permutation(int n, int w, int r) { string now; for(int i = 0; i < n; i++) { now.push_back('0'); } for(int i = 0; i < n; i++) { now[i]++; add_element(now); } compile_set(); vector<string> bits; now.clear(); for(int i = 0; i < n; i++) { now.push_back('0'); } for(int i = 0; i < n; i++) { if(i != 0) { now[i-1]--; } now[i]++; bits.push_back(now); } vint ans(n); string already; for(int i = 0; i < n; i++) { already.push_back('0'); } for(int i = 0; i < n; i++) { for(int j = 0; j < n; j++) { bool a = false; for(int k = 0; k < n; k++) { if(already[k] == '1' && k == j) { a = true; break; } } if(!a) { string x = already; x[j]++; if(check_element(x)) { for(int k = 0; k < n; k++) { if(already[k] != x[k]) { ans[i] = k; break; } } already = x; break; } } } } return ans; } /* int32_t main(){ startt int t = 1; //cin >> t; while (t--) { solve(); } } */
#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...