Submission #1093601

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
10936012024-09-27 06:24:42IrateData Transfer (IOI19_transfer)C++17
Compilation error
0 ms0 KiB
#include "transfer.h"
using namespace std;
vector<int> get_attachment(vector<int> source) {
int n = (int)source.size();
int XOR = 0, cnt = 0;
for(int i = 0;i < n;++i){
if(source[i]){
XOR ^= (i + 1);
cnt++;
}
}
vector<int>res;
if(n > 100){
for(int i = 0;i < 8;++i){
if(XOR & (1 << i)){
res.push_back(1);
}
else{
res.push_back(0);
}
}
}
else{
for(int i = 0;i < 6;++i){
if(XOR & (1 << i)){
res.push_back(1);
}
else{
res.push_back(0);
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

transfer.cpp: In function 'std::vector<int> retrieve(std::vector<int>)':
transfer.cpp:38:18: error: 'source' was not declared in this scope
   38 |     int n = (int)source.size();
      |                  ^~~~~~