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