# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
711024 | 2023-03-16T07:21:49 Z | becaido | Data Transfer (IOI19_transfer) | C++17 | 342 ms | 2500 KB |
#include <bits/stdc++.h> #include "transfer.h" using namespace std; vector<int> get_attachment(vector<int> source) { int n = source.size(), m = __lg(n + 1); vector<int> val(m + 1); for (int i = 1; i <= n; i++) if (source[i - 1]) { for (int j = 0; j < m; j++) if (i >> j & 1) val[j + 1] ^= 1; if (__builtin_popcount(i) == 1) val[0] ^= 1; } return val; } vector<int> differ(vector<int> a, vector<int> b) { vector<int> p; for (int i = 0; i < a.size(); i++) if (a[i] != b[i]) p.emplace_back(i); return p; } vector<int> retrieve(vector<int> data) { int n = (data.size() == 70 ? 63 : 255), m = __lg(n + 1); vector<int> val; while (data.size() > n) { val.emplace_back(data.back()); data.pop_back(); } reverse(val.begin(), val.end()); auto p = differ(get_attachment(data), val); if (p.size() <= 1) return data; int mask = 0; for (int i : p) if (i) mask |= 1 << i - 1; data[mask - 1] ^= 1; return data; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 652 KB | Output is correct |
2 | Correct | 4 ms | 740 KB | Output is correct |
3 | Correct | 4 ms | 644 KB | Output is correct |
4 | Correct | 4 ms | 728 KB | Output is correct |
5 | Correct | 5 ms | 652 KB | Output is correct |
6 | Correct | 7 ms | 644 KB | Output is correct |
7 | Correct | 7 ms | 644 KB | Output is correct |
8 | Correct | 6 ms | 768 KB | Output is correct |
9 | Correct | 7 ms | 628 KB | Output is correct |
10 | Correct | 7 ms | 728 KB | Output is correct |
11 | Correct | 6 ms | 728 KB | Output is correct |
12 | Correct | 6 ms | 652 KB | Output is correct |
13 | Correct | 6 ms | 728 KB | Output is correct |
14 | Correct | 5 ms | 652 KB | Output is correct |
15 | Correct | 5 ms | 644 KB | Output is correct |
16 | Correct | 6 ms | 644 KB | Output is correct |
17 | Correct | 5 ms | 644 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 65 ms | 2448 KB | Output is correct |
2 | Correct | 65 ms | 2460 KB | Output is correct |
3 | Correct | 68 ms | 2488 KB | Output is correct |
4 | Correct | 75 ms | 2444 KB | Output is correct |
5 | Correct | 136 ms | 2488 KB | Output is correct |
6 | Correct | 195 ms | 2452 KB | Output is correct |
7 | Correct | 249 ms | 2488 KB | Output is correct |
8 | Correct | 307 ms | 2496 KB | Output is correct |
9 | Correct | 334 ms | 2500 KB | Output is correct |
10 | Correct | 335 ms | 2488 KB | Output is correct |
11 | Correct | 342 ms | 2496 KB | Output is correct |
12 | Correct | 194 ms | 2496 KB | Output is correct |
13 | Correct | 193 ms | 2492 KB | Output is correct |
14 | Correct | 189 ms | 2488 KB | Output is correct |
15 | Correct | 184 ms | 2496 KB | Output is correct |
16 | Correct | 193 ms | 2488 KB | Output is correct |
17 | Correct | 196 ms | 2496 KB | Output is correct |
18 | Correct | 188 ms | 2488 KB | Output is correct |
19 | Correct | 182 ms | 2492 KB | Output is correct |