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>
using namespace std;
int id[1<<7],i,cnt;
vector<int>restore_permutation(int n,int w,int r){
iota(id,id+n,0);
srand(time(NULL));
random_shuffle(id,id+n);
vector<int>ans(n);
string s(n,'0');
for(i=0;i<n;i++){
s[id[i]]++;
add_element(s);
}
fill(s.begin(),s.end(),'0');
compile_set();
while(n-cnt)
for(i=0;i<n;i++)
if(~s[id[i]]&1){
s[id[i]]++;
if(check_element(s)){
ans[id[i]]=cnt++;
break;
}else s[id[i]]--;
}
return ans;
}
# | 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... |