제출 #958054

#제출 시각아이디문제언어결과실행 시간메모리
958054LalicUnscrambling a Messy Bug (IOI16_messy)C++17
49 / 100
1 ms532 KiB
#include "messy.h" #include <bits/stdc++.h> using namespace std; #define fi first #define se second #define pb push_back #define all(x) x.begin(), x.end() #define allr(x) x.rbegin(), x.rend() #define mp make_pair typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; const int MAXN = 2e5+10; const int MOD = 1e9+7; const int INF = 0x3f3f3f3f; const ll LINF = 0x3f3f3f3f3f3f3f3f; vector<int> restore_permutation(int n, int w, int r) { string s=""; for(int i=0;i<n;i++) s+='0'; for(int i=0;i<n;i++){ s[i]='1'; add_element(s); //cout << "added: " << s << "\n"; } compile_set(); s=""; for(int i=0;i<n;i++) s+='0'; srand(time(0)); vector<int> ans(n); for(int i=0;i<n;i++){ vector<int> ord; for(int j=0;j<n;j++){ if(s[j]=='1') continue; ord.pb(j); } random_shuffle(all(ord)); //cout << s << "\n"; for(auto u : ord){ s[u]='1'; if(check_element(s)){ //cout << s << "\n"; ans[u]=i; break; } s[u]='0'; } } //cout << (int)ans.size() << "\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...