제출 #571353

#제출 시각아이디문제언어결과실행 시간메모리
571353definitelynotmeeUnscrambling a Messy Bug (IOI16_messy)C++98
49 / 100
1 ms340 KiB
#include<bits/stdc++.h> using namespace std; #define ff first #define ss second #define all(x) x.begin(),x.end() using ll = long long; using pii = pair<int,int> ; using pll = pair<ll,ll>; template<typename T> using matrix = vector<vector<T>>; const int INF =(1<<30)-1; const ll INFL = (1ll<<61)-1; #include "messy.h" const int RANDOM = chrono::high_resolution_clock::now().time_since_epoch().count(); std::vector<int> restore_permutation(int n, int w, int r) { for(int i = 0; i < n; i++){ string s(n,'0'); fill(s.begin(),s.begin()+i+1,'1'); add_element(s); } compile_set(); vector<int> resp(n); string quest(n,'0'); vector<int> perm(n); iota(all(perm),0); mt19937 rng(RANDOM); for(int i = 0; i < n; i++){ shuffle(all(perm),rng); for(int j = 0; j < n; j++){ int id = perm[j]; if(quest[id]!='1'){ quest[id] = '1'; bool ret = check_element(quest); if(ret){ resp[id] = i; break; } quest[id] = '0'; } } } return resp; }
#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...