# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
213381 | _Ice_Tea_ | Data Transfer (IOI19_transfer) | C++14 | 318 ms | 3560 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
#include "transfer.h"
using namespace std;
std::vector<int> get_attachment(std::vector<int> source) {
int i,j;
int N = source.size();
vector<int> attach;
int key = 0;
for( i=0; i < N; i++)
{
attach.push_back( source[i] );
key ^= source[i];
}
attach.push_back(key);
return attach;
}
std::vector<int> retrieve(std::vector<int> data) {
int i,j;
int N = data.size() / 2;
vector<int> ans;
bool flag = 0;
for( i=0; i<N; i++)
{
if( data[i] != data[N+i] )
flag = 1;
}
if( flag )
{
int key = 0;
for( i=0; i<N; i++)
key ^= data[i];
if( key == data.back())
{
for( i=0; i<N; i++)
ans.push_back(data[i]);
}
else
{
for( i=0; i<N; i++)
ans.push_back(data[N+i]);
}
}
else
{
for( i=0; i<N; i++)
ans.push_back(data[i]);
}
return ans;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |