| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1366880 | abgfd324 | Data Transfer (IOI19_transfer) | C++20 | 75 ms | 1724 KiB |
#include<iostream>
#include<vector>
using namespace std;
vector<int> get_attachment(vector<int> source)
{
int x = 0;
int maxi, maxj;
vector<int> ans;
if(source.size() == 63)
{
maxi = 6;
maxj = 63;
}
else
{
maxi = 8;
maxj = 255;
}
for(int i = 0; i < maxi; i++)
{
int cur = 0;
for(int j = 1; j <= maxj; j++)
{
if(((j>>i)&1) == 1)
{
cur^=source[j-1];
}
}
x^=cur;
ans.push_back(cur);
}
ans.push_back(x);
return ans;
}
vector<int> retrieve(vector<int> data)
{
int x = 0;
int pr = 0;
int maxi, maxj;
if(data.size() == 70)
{
maxi = 6;
maxj = 63;
}
else
{
maxi = 8;
maxj = 255;
}
for(int i = maxj; i < maxj+maxi; i++) x^=data[i];
if(data[maxj+maxi] != x)
{
for(int i = 0; i < maxi+1; i++) data.pop_back();
return data;
}
else
{
for(int i = 0; i < maxi; i++)
{
int cur = 0;
for(int j = 1; j <= maxj; j++)
{
if(((j>>i)&1) == 1)
{
cur^=data[j-1];
}
}
if(cur != data[data.size()-maxi-1+i])
{
pr|=(1<<i);
}
}
if(pr != 0) data[pr-1]^=1;
for(int i = 0; i < maxi+1; i++) data.pop_back();
return data;
}
}Compilation message (stderr)
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
