제출 #807814

#제출 시각아이디문제언어결과실행 시간메모리
807814LIFUnscrambling a Messy Bug (IOI16_messy)C++14
38 / 100
1 ms340 KiB
#include <vector> #include "messy.h" #include<bits/stdc++.h> using namespace std; bool confirm[300005]; int go[300005]; int pp[300005]; std::vector<int> restore_permutation(int n, int w, int r) { srand(time(0)); for(int i=1;i<=n;i++) { string temp; for(int j=1;j<=i;j++)temp += "1"; for(int j=i+1;j<=n;j++)temp += "0"; add_element(temp); //cout<<temp<<endl; go[i-1] = -1; } compile_set(); for(int i=0;i<n;i++) { string test; for(int j=0;j<n;j++)confirm[j] = false; for(int j=0;j<n;j++)test += "0"; //for(int j=0;j<n;j++)cout<<go[j]<<" "; for(int k=0;k<n;k++) { if(go[k] != -1) { test[go[k]] = '1'; confirm[go[k]] = true; } } for(int j=0;j<n;j++)pp[j] = j; /*for(int j=n-1;j>=0;j--) { int xx = (rand() % (j+1)); swap(pp[xx],pp[j]); }*/ random_shuffle(pp,pp+n); for(int j=0;j<n;j++) { int k = pp[j]; if(confirm[k] == true)continue; test[k] = '1'; if(check_element(test) == true) { go[i] = k; test[k] = '0'; break; } // cout<<test<<endl; test[k] = '0'; } } vector<int> ans; for(int i=0;i<n;i++) { for(int j=0;j<n;j++)if(go[j] == i)ans.push_back(j); } return ans; /*add_element("0"); compile_set(); check_element("0"); return std::vector<int>();*/ }
#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...