제출 #1120542

#제출 시각아이디문제언어결과실행 시간메모리
1120542NotLinuxUnscrambling a Messy Bug (IOI16_messy)C++17
49 / 100
2 ms592 KiB
#include "messy.h" #include <bits/stdc++.h> using namespace std; mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); vector<int> restore_permutation(int n, int w, int r) { string str; for(int i = 0;i<n;i++)str += '0'; for(int i = 0;i<n;i++){ str[i] = '1'; add_element(str); } for(int i = 0;i<n;i++)str[i] = '0'; compile_set(); int perm[n] , vis[n] = {0}; for(int i = 0;i<n;i++)perm[i] = i; shuffle(perm , perm + n , rng); vector < int > ans(n); for(int i = 0;i<n;i++){ for(int j = 0;j<n;j++){ if(vis[perm[j]])continue; str[perm[j]] = '1'; if(check_element(str)){ ans[perm[j]] = i; // cout << "ans : " << perm[j] << " = " << i << endl; vis[perm[j]] = 1; break; } else{ str[perm[j]] = '0'; } } } return ans; // add_element("0"); // compile_set(); // check_element("0"); // return std::vector<int>(); }
#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...