#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[64+i]) ++ile;
if(ile>1) {
int jaki=-1;
rep(i, 6) if(P[i]!=T[64+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;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3 ms |
904 KB |
WA in grader: wrong source retrieval |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
9 ms |
4476 KB |
WA in grader: wrong source retrieval |
2 |
Halted |
0 ms |
0 KB |
- |