Submission #292114

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
2921142020-09-06 11:24:33AutoratchData Transfer (IOI19_transfer)C++14
100 / 100
428 ms2804 KiB
#include "transfer.h"
#include <bits/stdc++.h>
using namespace std;
int n,k;
int ret[10],mxk;
vector<int> s;
vector<int> get_attachment(vector<int> source)
{
n = source.size();
if(n==63) k = 6;
else k = 8;
for(int i = 0;i < k;i++) ret[i] = 0;
for(int i = 1;i <= n;i++) for(int j = 0;j < k;j++) if(i&(1 << j)) ret[j]^=source[i-1];
int all = 0;
for(int i = 0;i < k;i++) all^=ret[i];
vector<int> tmp;
for(int i = 0;i < k;i++) tmp.push_back(ret[i]);
tmp.push_back(all);
return tmp;
}
vector<int> retrieve(vector<int> data)
{
if(data.size()>200) n = 255,k = 8;
else n = 63,k = 6;
int all = 0;
for(int i = n;i < data.size();i++) all^=data[i];
if(all)
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

transfer.cpp: In function 'std::vector<int> retrieve(std::vector<int>)':
transfer.cpp:29:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   29 |     for(int i = n;i < data.size();i++) all^=data[i];
      |                   ~~^~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...