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>
//#include"grader.cpp"
using namespace std;
int id[1<<7],i,cnt;
vector<int>restore_permutation(int n,int w,int r){
iota(id,id+n,0);
vector<int>ans(n);
string s(n,'0');
for(i=0;i<n;i++){
s[id[i]]++;
add_element(s);
}
compile_set();
while(n-cnt)
for(i=0;i<n;i++)
if(s[id[i]]&1)s[id[i]]--;
else{
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... |