# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
952372 | 2024-03-23T16:14:04 Z | SmuggingSpun | Data Transfer (IOI19_transfer) | C++14 | 6 ms | 4624 KB |
#include "transfer.h" #include<bits/stdc++.h> using namespace std; vector<int>get_attachment(vector<int>source){ int BIT = (source.size() == 63 ? 6 : 8), x = 0, cnt_1 = 0; for(int i = 0; i < source.size(); i++){ if(source[i] == 1){ x ^= i + 1; cnt_1++; } } vector<int>data = source; for(int i = 0; i < BIT; i++){ if(1 << i & x){ data.emplace_back(1); } else{ data.emplace_back(0); } } data.emplace_back(cnt_1 & 1); return data; } vector<int>retrieve(vector<int>data){ int BIT = (data.size() == 70 ? 6 : 8), n = (BIT == 6 ? 63 : 255), sum_xor = 0, data_xor = 0, cnt_1 = 0; vector<int>ans(n); for(int i = 0; i < n; i++){ if(data[i] == 1){ sum_xor ^= i + 1; cnt_1++; } ans[i] = data[i]; } for(int i = 0; i < BIT; i++){ if(data[n + i]){ data_xor |= 1 << i; } } if(data_xor != sum_xor){ if((cnt_1 & 1) != data.back()){ ans[data_xor ^ sum_xor] ^= 1; } } return ans; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 1060 KB | WA in grader: wrong source retrieval |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 6 ms | 4624 KB | WA in grader: wrong source retrieval |
2 | Halted | 0 ms | 0 KB | - |