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 p[35];
std::vector<int> restore_permutation(int n, int w, int r)
{
vector<int> ans(n, 0);
for(int i = 1; i <= n; i ++)
{
string s = "";
for(int j = 1; j <=i; j ++)
{
s += "1";
}
for(int j = i + 1; j <=n; j ++)
{
s += "0";
}
//cout << s << '\n';
add_element(s);
}
compile_set();
string s = "";
for(int i =1; i <=n; i ++)
{
s += "0";
}
for(int i = 0; i <n; i ++)
{
for(int idx = 0; idx<n; idx ++)
{
if(s[idx] == '0')
{
string a = s;
a[idx] = '1';
//cout << a << '\n';
if(check_element(a))
{
ans[idx] = i;
s[idx] = '1';
break;
}
}
}
}
/*
for(auto a : ans)
{
cout << a << '\n';
}*/
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... |