| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1316472 | aaaaaaaa | Data Transfer (IOI19_transfer) | C++20 | 4 ms | 1712 KiB |
#include "transfer.h"
#include <bits/stdc++.h>
using namespace std;
std::vector<int> get_attachment(std::vector<int> source) {
vector<int> ans(7, 0);
int x = 0;
for(int i = 0; i < (int) source.size(); ++i){
x ^= source[i] * i;
}
int cnt = 0;
for(int i = 5; i >= 0; --i){
if(x & (1 << i)){
ans[i] = 1;
cnt += 1;
}
}
ans[6] = cnt & 1;
return ans;
}
std::vector<int> retrieve(std::vector<int> data) {
int n = data.size(), cnt = 0, x = 0;
for(int j = 5; j >= 0; --j){
if(data[n - j - 2]) {
cnt += 1;
x |= (1 << j);
}
}
vector<int> ans;
for(int j = 0; j < n - 7; ++j){
ans.push_back(data[j]);
}
if(cnt & 1 == data.back()){
int nx = 0;
for(int j = 0; j < n - 7; ++j){
if(data[j]) nx |= (1 << j);
}
for(int j = 0; j < n - 7; ++j){
if(nx ^ (1 << j) == x){
ans[j] ^= 1;
break;
}
}
}
return ans;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
