이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
std::vector<int> get_attachment(std::vector<int> v){
int xr = 0;
for (int i = 0; i < (int)v.size(); i++) xr ^= (i+1)*v[i];
int on = 0;
for (int i = 0; i < ((int)v.size()==63?6:8); i++){
v.push_back(xr&1);
if (xr&1) on = 1-on;
xr >>= 1;
}
v.push_back(on);
return v;
}
std::vector<int> retrieve(std::vector<int> v){
int n = ((int)v.size() < 100? 63 : 255);
int xr = 0;
std::vector<int> 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;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |