| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 829641 | haxorman | Data Transfer (IOI19_transfer) | C++14 | 4 ms | 2484 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "transfer.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> get_attachment(vector<int> source) {
int end = 0;
vector<int> res;
for (int j = 0; (1 << j) < source.size(); ++j) {
int val = 0;
for (int i = 0; i < source.size(); ++i) {
if (i & (1 << j)) {
val ^= source[i];
}
}
res.push_back(val);
end ^= val;
}
res.push_back(end);
return res;
}
vector<int> retrieve(vector<int> data) {
bool smol = (data.size() < 255);
vector<int> source;
for (int i = 0; i < data.size() - (smol ? 7 : 9); ++i) {
source.push_back(data[i]);
}
assert(source.size() == 63 || source.size() == 255);
int end = 0;
vector<int> lst;
for (int i = data.size() - (smol ? 7 : 9); i < data.size() - 1; ++i) {
lst.push_back(data[i]);
end ^= data[i];
}
if (end != data.back()) {
return source;
}
int bad = 0;
for (int j = 0; (1 << j) < source.size(); ++j) {
int val = 0;
for (int i = 0; i < source.size(); ++i) {
if (i & (1 << j)) {
val ^= source[i];
}
}
if (val != lst[j]) {
bad += (1 << j);
}
}
source[bad] ^= 1;
return source;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
