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>
using namespace std;
#define for2(a,b,c) for(int a=b;a<c;a++)
#include "messy.h"
vector<int> restore_permutation(int n, int w, int r) {
string s;
for2(i,0,n) s += "0";
for2(i,0,n){
s[i] = '1';
add_element(s);
}
compile_set();
vector<int> p(n);
vector<int> rnd(n);
for2(i,0,n) rnd[i] = i;
srand(10);
for2(i,0,n) s[i] = '0';
for2(i,0,n){
random_shuffle(rnd.begin(),rnd.end());
for(auto x : rnd) if(s[x] != '1'){
s[x] = '1';
if(check_element(s)){
p[x] = i;
break;
}
s[x] = '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... |