# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
920379 | Pannda | Data Transfer (IOI19_transfer) | C++17 | 30 ms | 2704 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "transfer.h"
#include <bits/stdc++.h>
using namespace std;
std::vector<int> get_attachment(std::vector<int> source) {
int n = source.size();
int xr = 0;
for (int i = 0; i < n; i++) {
xr ^= source[i] * (i + 1);
}
int k = n == 63 ? 6 : 8;
vector<int> attachment(k + 1);
for (int i = 0; i < k; i++) {
attachment[i] = xr >> i & 1;
}
attachment[k] = __builtin_popcount(xr) & 1;
return attachment;
}
std::vector<int> retrieve(std::vector<int> data) {
int n = data.size();
int k = n == 63 + 7 ? 6 : 8;
n -= k + 1;
int parity = 0;
for (int i = n; i < n + k + 1; i++) {
parity = (parity + data[i]) & 1;
}
if (!(parity & 1)) {
int xr = 0;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |