제출 #301314

#제출 시각아이디문제언어결과실행 시간메모리
301314williamMBDKUnscrambling a Messy Bug (IOI16_messy)C++17
38 / 100
2 ms384 KiB
#include<bits/stdc++.h> #include <vector> using namespace std; #include "messy.h" std::vector<int> restore_permutation(int N, int w, int r) { for(int i = 1; i <= N; i++){ string t = string(i,'0')+string(N-i,'1'); add_element(t); } compile_set(); vector<int> res (N); vector<bool> taken (N); for(int i = 1; i <= N; i++){ string s (N, '1'); for(int j = 0; j < N; j++){ if(taken[j]) s[j] = '0'; } vector<int> indices; for(int j = 0; j < N; j++) if(!taken[j]) indices.push_back(j); random_shuffle(indices.begin(), indices.end()); for(auto j : indices){ if(!taken[j]){ s[j] = '0'; if(check_element(s)){ res[j] = i-1; taken[j] = 1; break; } s[j] = '1'; } } } return res; }
#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...