제출 #1022072

#제출 시각아이디문제언어결과실행 시간메모리
1022072vjudge1Unscrambling a Messy Bug (IOI16_messy)C++17
38 / 100
1 ms604 KiB
#include "messy.h" #include <bits/stdc++.h> using namespace std; #define rall(s) s.rbegin(), s.rend() #define all(s) s.begin(), s.end() #define sz(s) (int)s.size() #define s second #define f first using ll = long long; using pii = pair<int, int>; using pll = pair<ll, ll>; const int N = 2e5 + 5; mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); vector<int> restore_permutation(int n, int w, int r) { string h = ""; for (int i = 0; i < n; i++) h += '0'; for (int i = 0; i < n - 1; i++) { h[i] = '1'; add_element(h); } compile_set(); for (int i = 0; i < n; i++) h[i] = '0'; vector<int> p(n), s; for (int i = 0; i < n; i++) s.push_back(i); shuffle(all(s), rng); for (int i = 0; i < n; i++) { for (int j: s) { if (h[j] == '1') continue; h[j] = '1'; if (i == n - 1 || check_element(h)) { p[j] = i; break; } h[j] = '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...