# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
143473 | 2019-08-14T08:25:25 Z | dolphingarlic | Data Transfer (IOI19_transfer) | C++14 | 138 ms | 2664 KB |
#include "transfer.h" std::vector<int> get_attachment(std::vector<int> source) { std::vector<int> v; int x = 0; for (int i = 0; i < source.size(); i++) if (source[i]) x ^= (i + 1); int last = 0; if (source.size() < 64) { for (int i = 0; i < 6; i++) { v.push_back(x & 1); if (x & 1) last = 1 - last; x >>= 1; } } else { for (int i = 0; i < 8; i++) { v.push_back(x & 1); if (x & 1) last = 1 - last; x >>= 1; } } v.push_back(last); return v; } std::vector<int> retrieve(std::vector<int> data) { int last = data.back(); data.pop_back(); int actual_last = 0, x = 0; if (data.size() < 71) { for (int i = 0; i < 6; i++) { x <<= 1; x += data.back(); if (data.back()) actual_last = 1 - actual_last; data.pop_back(); } } else { for (int i = 0; i < 8; i++) { x <<= 1; x += data.back(); if (data.back()) actual_last = 1 - actual_last; data.pop_back(); } } if (actual_last != last) return std::vector<int>(data.begin(), data.end()); int actual_x = 0; for (int i = 0; i < data.size(); i++) { if (data[i]) actual_x ^= (i + 1); } int error = actual_x ^ x; if (error == 0) return data; data[error - 1] = 1 - data[error - 1]; return data; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 6 ms | 1016 KB | Output is correct |
2 | Correct | 6 ms | 968 KB | Output is correct |
3 | Correct | 6 ms | 1016 KB | Output is correct |
4 | Correct | 6 ms | 1016 KB | Output is correct |
5 | Correct | 7 ms | 1016 KB | Output is correct |
6 | Correct | 6 ms | 1024 KB | Output is correct |
7 | Correct | 6 ms | 1024 KB | Output is correct |
8 | Correct | 6 ms | 1100 KB | Output is correct |
9 | Correct | 6 ms | 1016 KB | Output is correct |
10 | Correct | 6 ms | 1108 KB | Output is correct |
11 | Correct | 6 ms | 896 KB | Output is correct |
12 | Correct | 6 ms | 896 KB | Output is correct |
13 | Correct | 6 ms | 1024 KB | Output is correct |
14 | Correct | 6 ms | 1024 KB | Output is correct |
15 | Correct | 6 ms | 896 KB | Output is correct |
16 | Correct | 6 ms | 1016 KB | Output is correct |
17 | Correct | 6 ms | 972 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 61 ms | 2656 KB | Output is correct |
2 | Correct | 61 ms | 2604 KB | Output is correct |
3 | Correct | 61 ms | 2612 KB | Output is correct |
4 | Correct | 68 ms | 2472 KB | Output is correct |
5 | Correct | 69 ms | 2476 KB | Output is correct |
6 | Correct | 70 ms | 2652 KB | Output is correct |
7 | Correct | 68 ms | 2476 KB | Output is correct |
8 | Correct | 61 ms | 2636 KB | Output is correct |
9 | Correct | 55 ms | 2604 KB | Output is correct |
10 | Correct | 55 ms | 2612 KB | Output is correct |
11 | Correct | 54 ms | 2612 KB | Output is correct |
12 | Correct | 61 ms | 2664 KB | Output is correct |
13 | Correct | 67 ms | 2628 KB | Output is correct |
14 | Correct | 60 ms | 2612 KB | Output is correct |
15 | Correct | 63 ms | 2612 KB | Output is correct |
16 | Correct | 138 ms | 2612 KB | Output is correct |
17 | Correct | 64 ms | 2612 KB | Output is correct |
18 | Correct | 62 ms | 2608 KB | Output is correct |
19 | Correct | 58 ms | 2620 KB | Output is correct |