제출 #1121662

#제출 시각아이디문제언어결과실행 시간메모리
1121662Elwino008Unscrambling a Messy Bug (IOI16_messy)C++14
38 / 100
2 ms504 KiB
#include <vector> #include <bits/stdc++.h> using namespace std; #include "messy.h" 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; compile_set(); for(int t=n-1; t>0; t--){ int qwe=0; while(true){ while(a[qwe]=='1'){ qwe++; } 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...