| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1359607 | raineyj | Data Transfer (IOI19_transfer) | C++20 | 45 ms | 1724 KiB |
#include "transfer.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> get_attachment(vector<int> source)
{
vector<int> res;
int x=0;
for(int i=1; i<=source.size(); i++)
{
if(source[i-1]==1) x^=i;
}
int count=0;
if(source.size()==63)
{
for(int i=0; i<6; i++)
{
int val=x&1<<i;
if(val>0)
{
res.push_back(1);
count++;
}
else res.push_back(0);
}
}
else
{
for(int i=0; i<8; i++)
{
int val=x&1<<i;
if(val>0)
{
res.push_back(1);
count++;
}
else res.push_back(0);
}
}
res.push_back(count%2);
return res;
}
vector<int> retrieve(vector<int> data)
{
int n, k, count=0, x=0, y=0;
if(data.size()>=255)
{
n=255;
k=8;
}
else
{
n=63;
k=6;
}
vector<int> res;
for(int i=0; i<k; i++)
{
if(data[n+i]==1)
{
y=y|1<<i;
count++;
}
}
for(int i=1; i<=n; i++)
{
res.push_back(data[i-1]);
if(data[i-1]==1) x^=i;
}
if(data[n+k]!=(count%2)) return res;
else
{
int er=x^y;
if(er==0) return res;
else
{
res[er-1]=1-res[er-1];
return res;
}
}
}컴파일 시 표준 에러 (stderr) 메시지
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
