# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
541598 | status_coding | Unscrambling a Messy Bug (IOI16_messy) | C++14 | 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>
using namespace std;
string s;
void genQuery(int st, int dr)
{
int mij=(st+dr)/2;
for(int i=st;i<=mij;i++)
{
s[i]='1';
add_element(s);
s[i]='0';
}
for(int i=mij+1;i<=dr;i++)
s[i]='1';
genQuery(st, mij);
for(int i=mij+1;i<=dr;i++)
s[i]='0';
for(int i=st;i<=mij;i++)
s[i]='1';
genQuery(mij+1, dr);
}
void genAns(int st, int dr)
{
}
vector<int> restore_permutation(int n, int w, int r)
{
s.resize(n);
ans.resize(n);
for(int i=0;i<n;i++)
s[i]='0';
genQuery(0, n-1);
compile_set();
for(int i=0;i<n;i++)
s[i]='0';
genAns(0, n-1);
return ans;
}