#include "transfer.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define rep(a, b) for(int a = 0; a < (b); ++a)
#define st first
#define nd second
#define pb push_back
#define all(a) a.begin(), a.end()
vector<int>get_attachment(vector<int>T) {
if(T.size()==63) {
rep(i, 6) {
int akt=0;
rep(a, 63) if((a+1)&(1<<i)) akt^=T[a];
T.pb(akt);
}
int akt=0;
rep(a, 63) akt^=T[a];
T.pb(akt);
return T;
}
rep(i, 8) {
int akt=0;
rep(a, 255) if((a+1)&(1<<i)) akt^=T[a];
T.pb(akt);
}
int akt=0;
rep(a, 255) akt^=T[a];
T.pb(akt);
return T;
}
vector<int>retrieve(vector<int>T) {
if(T.size()<100) {
vector<int>P;
rep(i, 6) {
int akt=0;
rep(a, 63) if((a+1)&(1<<i)) akt^=T[a];
P.pb(akt);
}
int akt=0;
rep(a, 63) akt^=T[a];
P.pb(akt);
int ile=0;
rep(i, 7) if(P[i]!=T[63+i]) ++ile;
if(ile>1) {
int jaki=-1;
rep(i, 6) if(P[i]!=T[63+i]) jaki+=1<<i;
T[jaki]^=1;
}
rep(i, 7) T.pop_back();
return T;
}
vector<int>P;
rep(i, 8) {
int akt=0;
rep(a, 255) if((a+1)&(1<<i)) akt^=T[a];
P.pb(akt);
}
int akt=0;
rep(a, 255) akt^=T[a];
P.pb(akt);
int ile=0;
rep(i, 9) if(P[i]!=T[255+i]) ++ile;
if(ile>1) {
int jaki=-1;
rep(i, 8) if(P[i]!=T[255+i]) jaki+=1<<i;
T[jaki]^=1;
}
rep(i, 9) T.pop_back();
return T;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
908 KB |
WA in grader: wrong source retrieval |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
8 ms |
4468 KB |
WA in grader: wrong source retrieval |
2 |
Halted |
0 ms |
0 KB |
- |