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 "messy.h"
#include <vector>
#include <string>
using namespace std;
std::vector<int> restore_permutation(int N, int w, int r) {
vector<string> els;
for(int i = 0; i < N; i++) {
string str = "";
for(int j = 0; j < N; j++) {
if(j <= i) str += '1';
else str += '0';
}
add_element(str);
els.push_back(str);
}
compile_set();
vector<int> P(N, -1);
for(int i = 0; i < N; i++) {
string curr = "";
for(int j = 0; j < N; j++) {
if(P[j] != -1) curr += '1';
else curr += '0';
}
for(int j = 0; j < N; j++) {
if(curr[j] == '1') continue;
curr[j] = '1';
if(check_element(curr)) {
P[j] = i;
break;
}
curr[j] = '0';
}
}
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... |