제출 #1046933

#제출 시각아이디문제언어결과실행 시간메모리
1046933Gromp15Unscrambling a Messy Bug (IOI16_messy)C++17
38 / 100
1 ms348 KiB
#include <bits/stdc++.h> using namespace std; #include "messy.h" std::vector<int> restore_permutation(int n, int w, int r) { if (n * n <= r) { for (int i = 1; i <= n; i++) { add_element(string(i, '1') + string(n - i, '0')); } compile_set(); vector<int> ans(n, -1); string cur(n, '?'); for (int i = 0; i < n; i++) { int w = -1; for (int k = 0; k < n; k++) if (cur[k] == '?') { string tmp = cur; for (int j = 0; j < n; j++) if (tmp[j] == '?') { tmp[j] = j == k ? '1' : '0'; } if (check_element(tmp)) { cur[k] = '1'; w = k; break; } } ans[w] = i; } return ans; } 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...