This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <iostream>
#include <vector>
#include "messy.h"
using namespace std;
vector<int> restore_permutation(int n, int w, int r) {
for (int i = 1 ; i <= n ; ++ i) {
string cur = "";
for (int _ = 0 ; _ < i ; ++ _) cur += "1";
for (int _ = 0 ; _ < n - i ; ++ _) cur += "0";
add_element(cur);
}
compile_set();
vector<int>p(n, -1);
for (int i = 1 ; i <= n ; ++ i) {
string cur(n, '0');
for (int j = 0 ; j < n ; ++ j) if (p[j] != -1) cur[j] = '1';
for (int j = 0 ; j < n ; ++ j) if (cur[j] == '0') {
string temp = cur;
temp[j] = '1';
if (check_element(temp)) {
p[j] = i - 1;
break;
}
}
}
return p;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |