# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1121914 | Moonn | Unscrambling a Messy Bug (IOI16_messy) | C++17 | 0 ms | 0 KiB |
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>
#define ll long long
#define endl "\n";
#define AI ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;
vector<ll>restore_permutation(ll n,ll w,ll r)
{
vector<string>q;
string a="1";
q.push_back(a);
for(ll i=1;i<n;i++)
a+="0";
for(ll i=0;i<n;i++)
{
a[i]='1';
q.push_back(a);
}
for(ll i=0;i<n;i++)
add_element(q[i]);
compile_set();
vector<ll>pp(n);
a=q[0];
for(ll i=0;i<n;i++)
{
a[i]='0';
for(ll j=0;j<n;j++)
{
a[j]='1';
if(check_element(a))
{
pp[i]=j;
break;
}
}
}
return pp;
}