Submission #213381

#TimeUsernameProblemLanguageResultExecution timeMemory
213381_Ice_Tea_Data Transfer (IOI19_transfer)C++14
15 / 100
318 ms3560 KiB
#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)

transfer.cpp: In function 'std::vector<int> get_attachment(std::vector<int>)':
transfer.cpp:8:8: warning: unused variable 'j' [-Wunused-variable]
  int i,j;
        ^
transfer.cpp: In function 'std::vector<int> retrieve(std::vector<int>)':
transfer.cpp:24:8: warning: unused variable 'j' [-Wunused-variable]
  int i,j;
        ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...