제출 #1121699

#제출 시각아이디문제언어결과실행 시간메모리
1121699Elwino008Unscrambling a Messy Bug (IOI16_messy)C++14
0 / 100
3 ms512 KiB
#include <vector> #include <bits/stdc++.h> using namespace std; #include "messy.h" mt19937 engine(time(NULL)); std::vector<int> restore_permutation(int n, int w, int r){ string s=""; for(int i=0; i<n; i++){ s=s+'1'; string q=""; for(int j=0; j<n-i-1; j++){ q=q+'0'; } q=q+s; add_element(q); } char a[200]; for(int i=0; i<n; i++){ a[i]='0'; } map<int, int>ans; uniform_int_distribution<>gen(0, n-2); compile_set(); for(int t=n-1; t>0; t--){ int qwe=gen(engine); while(true){ while(a[qwe]=='1'){ qwe=gen(engine); } string q=""; for(int i=0; i<n; i++){ if(a[i]=='1'){ q+=a[i]; continue; } if(i==qwe){ q+='1'; } else{ q+='0'; } } if(check_element(q)){ a[qwe]='1'; ans[qwe]=t; break; } qwe++; } } vector<int>res; for(int i=0; i<n; i++){ res.push_back(ans[i]); } 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...