| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1344644 | MunkhErdene | Data Transfer (IOI19_transfer) | C++17 | 22 ms | 1724 KiB |
#include "transfer.h"
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define ff first
#define ss second
#define _ << " " <<
#define yes cout<<"YES\n"
#define no cout<<"NO\n"
#define ull unsigned long long
#define lll __int128
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define BlueCrowner ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define FORD(i, a, b) for (ll i = (a); i >= (b); i--)
vector<int> get_attachment(vector<int> s) {
vector<int> v;
int x = 0;
FOR(i, 0, s.size()) if (s[i]) x ^= (i + 1);
int y = 0;
FOR(bit, 0, 8) {
v.pb(x & 1);
if (x & 1) y ^= 1;
x >>= 1;
}
v.pb(y);
return v;
}
std::vector<int> retrieve(std::vector<int> d) {
int y = d.back();
d.pop_back();
int y0 = 0, x = 0;
FOR(bit, 0, 8) {
x <<= 1;
x += d.back();
if (d.back()) y0 = 1 - y0;
d.pop_back();
}
if (y0 != y) return vector<int>(d.begin(), d.end());
int x0 = 0;
FOR(i, 0, d.size()) {
if (d[i]) x0 ^= (i + 1);
}
int pos = x0 ^ x;
if (pos == 0) return d;
d[pos - 1] = 1 - d[pos - 1];
return d;
}
Compilation message (stderr)
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
