제출 #433425

#제출 시각아이디문제언어결과실행 시간메모리
433425MonchitoUnscrambling a Messy Bug (IOI16_messy)C++14
20 / 100
1 ms332 KiB
#include <vector> #include "messy.h" #include <iostream> using namespace std; vector<int> restore_permutation(int n, int w, int r) { vector<string> s(n); for(int i=0; i<n; i++) { for(int j=0; j<n; j++) (i%2==0)? s[i].push_back('0') : s[i].push_back('1'); for(int j=0; j<=i; j++) (i%2==0)? s[i][j] = '1' : s[i][j] = '0'; add_element(s[i]); } compile_set(); vector<int> ans(n); for(int i=0; i<n; i++) ans[i] = i; bool flag = false; for(int i=0; i<n; i++) { for(int j=i+1; j<n; j++) { swap(s[i][i], s[i][j]); if(check_element(s[i])) { swap(ans[i], ans[j]); flag = true; break; } swap(s[i][i], s[i][j]); } if(flag) break; } return ans; }
#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...