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>
#define ll int
#define f first
#define s second
#define pb push_back
using namespace std;
#include "messy.h"
vector<int> restore_permutation(int n, int w, int r){
srand(time(NULL));
string s = "";
for(int i=1; i<=n; i++)
s += '0';
for(int i=0; i<n; i++){
s[i] = '1';
add_element(s);
}
compile_set();
string a = "";
for(int i=0; i<n; i++)
a += '0';
vector<ll>p;
for(int i=0; i<n; i++)
p.pb(0);
for(int i=0; i<n; i++){
vector<ll>k;
for(int j=0; j<n; j++)
if(a[j] == '0')
k.pb(j);
random_shuffle(k.begin() , k.end());
random_shuffle(k.begin() , k.end());
random_shuffle(k.begin() , k.end());
for(int ji=0; ji<n; ji++){
int j = k[ji];
if(a[j] == '0'){
a[j] = '1';
if(check_element(a)){
//cout << i << " <-> " << j << '\n';
p[j] = i;
break;
}
a[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... |