# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
986393 | Pyqe | Unscrambling a Messy Bug (IOI16_messy) | C++17 | 2 ms | 856 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;
long long nd;
vector<int> restore_permutation(int n,int d,int d2)
{
long long i,j,r;
string s="";
vector<int> sq;
for(nd=0;1ll<<nd<n;nd++);
for(i=0;i<n;i++)
{
s+="0";
sq.push_back(0);
}
for(i=nd-1;i+1;i--)
{
for(j=0;j<n;j++)
{
if(j>>i&1)
{
for(r=0;r<n;r++)
{
s[r]=(r==j||r>>i+1!=j>>i+1)+'0';
}
add_element(s);
}
}
}
compile_set();
for(i=nd-1;i+1;i--)
{
for(j=0;j<n;j++)
{
for(r=0;r<n;r++)
{
s[r]=(r==j||sq[r]>>i+1!=sq[j]>>i+1)+'0';
}
sq[j]|=check_element(s)<<i;
}
}
return sq;
}
Compilation message (stderr)
# | 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... |