| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1322077 | Thanhs | Data Transfer (IOI19_transfer) | C++20 | 7 ms | 3244 KiB |
#include "transfer.h"
#include <bits/stdc++.h>
using namespace std;
#define name "TENBAI"
#define fi first
#define se second
#define endl '\n'
#define setmin(x, y) x = min((x), (y))
#define setmax(x, y) x = max((x), (y))
#define sqr(x) ((x) * (x))
#define all(x) x.begin(), x.end()
mt19937 hdp(chrono::high_resolution_clock::now().time_since_epoch().count());
int rand(int l, int r){return l + ((hdp() % (r - l + 1)) + r - l + 1) % (r - l + 1);}
vector<int> get_attachment(vector<int> source) {
vector<int> send(source.size() + __lg(source.size() + 1) + 1);
int t = 0, z = 0;
for (int i = 0; i < (int)source.size(); i++)
{
send[i] = source[i];
if (send[i])
t ^= i + 1;
z ^= 1;
}
for (int i = 0; i <= __lg(source.size()); i++)
if (t >> i & 1)
send[source.size() + i] = 1;
send.back() = z;
return send;
}
vector<int> retrieve(vector<int> data) {
int n = data.size() < 256 ? 63 : 255;
vector<int> ans(n, 0);
int y = 0, z = 0;
for (int i = 0; i < (int)data.size(); i++)
if (data[i])
{
if (i < n)
{
ans[i] = 1;
y ^= i + 1;
z ^= 1;
}
else if (i < (int)data.size() - 1)
y ^= 1 << i - n;
else
z ^= 1;
}
if (y && z)
ans[y - 1] ^= 1;
return ans;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
