제출 #138149

#제출 시각아이디문제언어결과실행 시간메모리
138149HassoonyUnscrambling a Messy Bug (IOI16_messy)C++17
38 / 100
3 ms504 KiB
#include <bits/stdc++.h> #include "messy.h" //#include "grader.cpp" using namespace std; typedef long long ll; const int MX=50; int ans[MX],ans1[MX]; vector<int> restore_permutation(int n, int w, int r) { string tmp=""; for(int i=0;i<n;i++)tmp+="0"; for(int i=0;i<n;i++){ tmp[i]='1'; add_element(tmp); } for(int i=0;i<n;i++)ans[i]=i; compile_set(); string Cur=""; for(int i=0;i<n;i++)Cur+="0"; for(int i=0;i<n;i++){ // cout<<Cur<<endl; for(int j=0;j<n;j++){ if(Cur[j] == '1')continue; Cur[j]='1'; if(check_element(Cur)){ ans[i]=j; break; } Cur[j]='0'; } } vector<int>v; for(int i=0;i<n;i++)ans1[ans[i]]=i; for(int i=0;i<n;i++)v.push_back(ans1[i]); return v; }
#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...