# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
623451 | 2022-08-05T15:45:30 Z | lcj | Data Transfer (IOI19_transfer) | C++17 | 7 ms | 2472 KB |
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> pll; typedef pair<int, int> pii; #include "transfer.h" std::vector<int> get_attachment(std::vector<int> source) { int n = source.size(); int k; if (n == 63) { k = 6; } else { k = 8; } vector<int> at(k+1, 0); for (int i = 1; i <= n; i++) { for (int j = 0; j < k; j++) { if (i & (1 << j)) { at[j] ^= (bool)(source[i-1] & (1 << j)); } } } for (int i = 0; i < k; i++) { at[k] ^= at[i]; } return at; } std::vector<int> retrieve(std::vector<int> data) { int n, k; if (data.size() == 70) { n = 63; k = 6; } else { n = 255; k = 8; } int cxor = 0; for (int i = n; i <= data.size(); i++) { cxor ^= data[i]; } if (cxor) { return vector<int>(data.begin(), data.begin()+n); } vector<int> at(k+1, 0); for (int i = 1; i <= n; i++) { for (int j = 0; j < k; j++) { if (i & (1 << j)) { at[j] ^= (bool)(data[i-1] & (1 << j)); } } } int num = 0; for (int j = 0; j < k; j++) { if (data[n+j] != at[j]) { num |= (1 << j); } } data[num] ^= 1; return std::vector<int>(data.begin(), data.begin()+n); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 4 ms | 784 KB | WA in grader: wrong source retrieval |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 7 ms | 2472 KB | WA in grader: wrong source retrieval |
2 | Halted | 0 ms | 0 KB | - |