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 <bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
using namespace std;
typedef pair<int,int>P;
vector<int> restore_permutation(int n, int w, int r) {
if(n<=32){
rep(i,n){
string s;
rep(j,n){
if(j<=i)s+='0';
else s+='1';
}
add_element(s);
}
compile_set();
vector<int>v(n),p(n);//p[v[i]]=i
rep(i,n){
string s(n,'1');
rep(j,i)s[v[j]]='0';
rep(j,n){
if(s[j]=='0')continue;
s[j]='0';
if(check_element(s)){
v[i]=j;break;
}
s[j]='1';
}
}
rep(i,n){
p[v[i]]=i;
}
return p;
}
if(n==32){
}
return {};
}
# | 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... |