Submission #711386

#TimeUsernameProblemLanguageResultExecution timeMemory
711386mseebacherParrots (IOI11_parrots)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "encoder.h" #include "encoderlib.h" using namespace std; void encode(int x, int m[]){ for(int i = 0;i<x;i++){ int y = m[i]; for(int j = 0;j<8;j++){ if((1<<j)&m[i]) y |= (1 << (8+j)); } send(y); } }
#include <bits/stdc++.h> #include "encoder.h" #include "encoderlib.h" using namespace std; void decode(int x,int l,int m[]){ vector<int> ans(x+1); for(int i = 0;i<n;i++){ int index = 0; for(int j = 8;j<=16;j++){ if(m[i] & 1 << (j)){ m[i] -= (1 << j); index += (1 << (j-8)); } } ans[index] = m[i]; } for(int i = 1;i<=x;i++){ output(ans[i]); } }

Compilation message (stderr)

decoder.cpp: In function 'void decode(int, int, int*)':
decoder.cpp:8:18: error: 'n' was not declared in this scope
    8 |  for(int i = 0;i<n;i++){
      |                  ^
decoder.cpp:19:3: error: 'output' was not declared in this scope
   19 |   output(ans[i]);
      |   ^~~~~~