# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
213573 | _Ice_Tea_ | Data Transfer (IOI19_transfer) | C++14 | 337 ms | 2924 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#include "transfer.h"
#define de(x) if( x && x == MODE)
#define MODE 0
using namespace std;
std::vector<int> get_attachment(std::vector<int> source) {
int i,j,k;
int N = source.size();
int L = ( N == 63 ? 6 : 8 );
// int L = 3;
vector<int> attach;
for( i=0; i<L; i++)
{
int key = 0;
for( j=0; j<N; j++)
{
if( (j>>i)&1 )
continue;
key ^= source[j];
}
attach.push_back(key);
}
int key = 0;
for( auto it:attach)
key ^= it;
attach.push_back(key);
de(1)
{
printf(">>> ");
for( auto it:attach)
printf("%d ", it);
printf("\n");
}
return attach;
}
std::vector<int> retrieve(std::vector<int> data) {
int i,j;
int N = ( data.size() == 70 ? 63 : 255);
// int N = 7;
int L = data.size() - N - 1;
vector<int> ans;
int arr[256];
int idx = 0;
for( i=0; i<L; i++)
{
int key = 0;
for( j=0; j<N; j++)
{
if( (j>>i)&1 )
continue;
key ^= data[j];
}
if( key == data[ N+i ])
idx ^= (1<<i);
}
de(1) printf("idx = %d\n", idx);
for( i=0; i<N; i++)
ans.push_back( data[i] );
if( idx == N)
{
// return ans;
}
else
{
int key = 0;
for( i=0; i<L; i++)
key ^= data[ N+i ];
if( key != data.back())
{
// return ans;
}
else
{
ans[idx] ^= 1;
// return ans;
}
}
de(1)
{
printf("ans = ");
for( auto it: ans)
printf("%d", it);
printf("\n");
}
return ans;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |