제출 #1121692

#제출 시각아이디문제언어결과실행 시간메모리
1121692vjudge1Unscrambling a Messy Bug (IOI16_messy)C++17
38 / 100
2 ms508 KiB
#include <bits/stdc++.h> #include "messy.h" using namespace std; mt19937 rng(time(NULL)); std::vector<int> restore_permutation(int n, int w, int r) { string S(n, '0'), res(n, '0'); for (int i = 0;i < n;i ++) { S[i] = '1'; add_element (S); } compile_set (); vector<int> p(n, 0), used(n, 0); vector<int> index(n); for (int i = 0;i < n;i ++) index.push_back(i); shuffle(index.begin(), index.end(), rng); function<void(int)> func = [&](int ind) -> void { if (ind == n) return; for (auto i : index) if (used[i] == 0) { res[i] = '1'; if (check_element (res) == 1) { used[i] = 1; p[i] = ind; break; } res[i] = '0'; } func (ind + 1); }; func (0); return p; }
#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...