# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
598752 | farhan132 | Data Transfer (IOI19_transfer) | C++17 | 205 ms | 2500 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "transfer.h"
#include <bits/stdc++.h>
using namespace std;
typedef int ll;
typedef pair<ll , ll> ii;
#define ff first
#define ss second
#define pb push_back
#define in insert
std::vector<int> get_attachment(std::vector<int> source) {
ll n = source.size();
ll lg = log2(n + 1);
ll x = 0;
for(auto u : source) x ^= u;
source.pb(x);
vector < ll > ans; ans.pb(x);
n++;
for(ll bit = 0; bit < lg; bit++){
x = 0;
for(ll i = 0; i < n; i++){
if((i >> bit)&1) x ^= source[i];
}
ans.pb(x);
}
return ans;
}
std::vector<int> retrieve(std::vector<int> data) {
ll n = 256;
if(data.size() < n) n = 64;
ll x = 0;
for(ll i = 0; i < n - 1; i++){
x ^= data[i];
}
if(data[n - 1] != x){
ll m = data.size();
ll cur = 0;
for(ll j = n; j < m; j++){
ll bit = j - n; x = 0;
for(ll i = 0; i < n; i++){
if((i >> bit)&1) x ^= data[i];
}
if(x != data[j]) cur |= (1 << bit);
}
data[cur] ^= 1;
}
while(data.size() > n-1) data.pop_back();
return data;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |