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<bits/stdc++.h>
#include "messy.h"
#define MAXN 10007
using namespace std;
int n;
string curr,zero;
int p[MAXN];
bool used[MAXN];
vector<int> ans;
vector<int> restore_permutation(int N, int w, int r){
n=N;
for(int i=1;i<=n;i++)zero.push_back('0');
for(int i=0;i<n;i++){
curr=zero;
for(int f=0;f<=i;f++)curr.push_back('1');
add_element(curr);
}
compile_set();
for(int i=0;i<n;i++){
curr=zero;
for(int f=0;f<i;f++){
curr[p[f]]='1';
}
for(int f=0;f<n;f++){
if(!used[p[f]]){
curr[f]='1';
if(check_element(curr)){
p[i]=f; used[f]=true; break;
}
curr[f]='0';
}
}
}
for(int i=0;i<n;i++){
ans.push_back(p[i]);
}
return ans;
}
/*
int main(){
}
*/
# | 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... |