# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
829649 | 2023-08-18T13:46:53 Z | Rifal | Data Transfer (IOI19_transfer) | C++14 | 6 ms | 2492 KB |
#include <bits/stdc++.h> #include "transfer.h" using namespace std; std::vector<int> get_attachment(std::vector<int> source) { vector<int> v; int cnt = 0; for(int i = 0; i < source.size(); i++) { /// v.push_back(source[i]); if(source[i] == 1) cnt ^= i; } int cnt2 = 0; for(int i = 0; i < 8; i++) { if((cnt&(1<<i)) > 0) { v.push_back(1); cnt2++; } else { v.push_back(0); } } if(cnt2%2 == 0) v.push_back(0); else v.push_back(1); return v; } std::vector<int> retrieve(std::vector<int> data) { vector<int> v; int siz = data.size(); int a = 0, b = 0, cnt = 0; for(int i = 0; i < siz-9; i++) { v.push_back(data[i]); if(data[i] == 1) a ^= i; } for(int i = siz-9; i < siz-2; i++) { if(data[i] == 1) { b += (1<<(i-(siz-9))); cnt++;} } if(b == a) return v; if(cnt%2 != data[siz-1]) return v; int x = (a^b); v[x] ^= 1; return v; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 768 KB | WA in grader: wrong source retrieval |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 6 ms | 2492 KB | WA in grader: wrong source retrieval |
2 | Halted | 0 ms | 0 KB | - |