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;
#define sz(v) ((int)(v).size())
typedef long long lint;
bool C;
vector<int> restore_permutation(int n, int w, int r) {
vector<int>ans;
if(w==256)
{
for(int i=0;i<n;i++)
{
ans.push_back(i);
}
string a[7];
a[0]="10000000";
a[1]="11000000";
a[2]="11100000";
a[3]="11110000";
a[4]="11111000";
a[5]="11111100";
a[6]="11111110";
for(int i=0;i<7;i++)add_element(a[i]);
compile_set();
int ch=0;
for(int j=0;j<8;j++)
{
for(int k=j+1;k<8;k++)
{
ch=0;
for(int i=0;i<7;i++)
{
swap(a[i][j],a[i][k]);
C=check_element(a[i]);
if(C)ch++;
swap(a[i][j],a[i][k]);
}
if(ch==7)
{
swap(ans[j],ans[k]);
j=8;
break;
}
}
}
}
else if(w==320)
{
string a[32];
for(int i=0;i<32;i++)a[0]+='0';
for(int i=1;i<32;i++)
{
for(int j=0;j<i;j++)a[i]+='1';
for(int j=i;j<32;j++)a[i]+='0';
add_element(a[i]);
}
compile_set();
for(int i=0;i<32;i++)
{
string b=a[0];
for(int j=0;j<i;j++)
{
b[ans[j]]='1';
}
for(int j=0;j<32;j++)
{
if(b[j]=='1')continue;
else
{
b[j]='1';
if(i==31)
{
ans.push_back(j);
break;
}
C=check_element(b);
if(C)
{
ans.push_back(j);
break;
}
b[j]='0';
}
}
}
}
else if(w==1024)
{
}
else if(w==1792)
{
}
else // w==896
{
}
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... |