# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
748191 | Szil | Data Transfer (IOI19_transfer) | C++17 | 1450 ms | 2496 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "transfer.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> get_attachment(vector<int> source) {
vector<int> res;
int K = (source.size()<100?6:8);
int safe = 0;
for (int i = 0; i < K; i++) {
int x = 0;
int block = 1 << i;
for (int j = 0; j < source.size(); j++) {
if ((j / block) % 2 == 0) {
x ^= source[j];
}
}
res.push_back(x);
safe ^= x;
}
res.push_back(safe);
return res;
}
vector<int> retrieve(vector<int> data) {
int n;
if (data.size() < 100) {
n = 63;
} else {
n = 255;
}
int safe = data.back();
vector<int> source = vector<int>(data.begin(), data.begin()+n);
vector<int> cnt(n);
vector<int> v = vector<int>(data.begin()+n, data.end()-1);
int K = (source.size()<100?6:8);
int p = 0;
for (int i : v) p ^= i;
if (p != safe) return source;
for (int i = 0; i < K; i++) {
int x = 0;
int block = 1 << i;
for (int j = 0; j < n; j++) {
if ((j / block) % 2 == 0) {
x ^= source[j];
}
}
for (int j = 0; j < n; j++) {
if ((j / block) % 2 == (x == v[i])) {
cnt[j]++;
}
}
}
for (int i = 0; i < n; i++) {
if (cnt[i] == K) {
source[i] ^= 1;
return source;
}
}
return source;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |