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 <vector>
#include <cstdio>
#include <string>
#include <set>
#include <cstdlib>
#include <iostream>
#include "messy.h"
using namespace std;
vector<int> restore_permutation(int N, int W, int R){
string s = string(N, '0');
for(int i = 0; i < N; i ++){
s[i] = '1';
add_element(s);
}
compile_set();
string ans = string(N, '0');
vector<int> perm(N);
for(int i = 0; i < N; i ++){
for(int j = 0; j < N; j ++){
string temp = ans;
if(ans[j] == '0'){
temp[j] = '1';
bool good = check_element(temp);
if(good){
ans[j] = '1';
perm[j] = i;
break;
}
}
}
}
return perm;
}
# | 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... |