#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;
for(int i=0;i<n;i++)
{
ans.push_back(i);
}
if(w==256)
{
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];
vector<int>rev;
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[rev[j]]='1';
}
for(int j=0;j<32;j++)
{
if(b[j]=='1')continue;
else
{
b[j]='1';
if(i==31)
{
rev.push_back(j);
break;
}
C=check_element(b);
if(C)
{
rev.push_back(j);
break;
}
b[j]='0';
}
}
}
for(int i=0;i<32;i++)ans[rev[i]]=i;
}
else if(w==1024)
{
}
else if(w==1792)
{
}
else // w==896
{
}
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
n = 8 |
2 |
Correct |
0 ms |
212 KB |
n = 8 |
3 |
Correct |
0 ms |
212 KB |
n = 8 |
4 |
Correct |
0 ms |
212 KB |
n = 8 |
5 |
Correct |
0 ms |
212 KB |
n = 8 |
6 |
Correct |
0 ms |
212 KB |
n = 8 |
7 |
Correct |
0 ms |
212 KB |
n = 8 |
8 |
Correct |
0 ms |
212 KB |
n = 8 |
9 |
Correct |
0 ms |
212 KB |
n = 8 |
10 |
Correct |
0 ms |
212 KB |
n = 8 |
11 |
Correct |
1 ms |
212 KB |
n = 8 |
12 |
Correct |
0 ms |
212 KB |
n = 8 |
13 |
Correct |
0 ms |
212 KB |
n = 8 |
14 |
Correct |
0 ms |
212 KB |
n = 8 |
15 |
Correct |
0 ms |
212 KB |
n = 8 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
n = 32 |
2 |
Correct |
1 ms |
212 KB |
n = 32 |
3 |
Correct |
1 ms |
212 KB |
n = 32 |
4 |
Correct |
1 ms |
212 KB |
n = 32 |
5 |
Correct |
1 ms |
256 KB |
n = 32 |
6 |
Correct |
0 ms |
212 KB |
n = 32 |
7 |
Correct |
1 ms |
212 KB |
n = 32 |
8 |
Correct |
0 ms |
212 KB |
n = 32 |
9 |
Correct |
1 ms |
212 KB |
n = 32 |
10 |
Correct |
0 ms |
212 KB |
n = 32 |
11 |
Correct |
1 ms |
212 KB |
n = 32 |
12 |
Correct |
0 ms |
212 KB |
n = 32 |
13 |
Correct |
0 ms |
300 KB |
n = 32 |
14 |
Correct |
1 ms |
212 KB |
n = 32 |
15 |
Correct |
0 ms |
212 KB |
n = 32 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
grader returned WA |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
grader returned WA |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
grader returned WA |
2 |
Halted |
0 ms |
0 KB |
- |