#include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
#define siz(x) (int)x.size()
vi get_attachment(vi v){
int xr = 0;
for (int i = 0; i < siz(v); i++) xr ^= (i+1)*v[i];
int on = 0;
for (int i = 0; i < (siz(v)==63?6:8); i++){
v.push_back(xr&(1<<i)?1:0);
if (xr&(1<<i)) on ^= 1;
}
v.push_back(on);
return v;
}
vi retrieve(vi v){
int n = (siz(v) < 100? 63 : 255);
int xr = 0;
vi res;
for (int i = 0; i < n; i++){
xr ^= (i+1)*v[i];
res.push_back(v[i]);
}
int check = 0, on = 0;
for (int i = 0; i < (n==63?6:8); i++){
if (v[n+i]){
check ^= (1<<i);
on ^= 1;
}
}
if (xr != check && on == v.back()) res[(xr^check)-1] ^= 1;
return res;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3 ms |
908 KB |
WA in grader: wrong source retrieval |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
8 ms |
4476 KB |
WA in grader: wrong source retrieval |
2 |
Halted |
0 ms |
0 KB |
- |