Submission #934680

#TimeUsernameProblemLanguageResultExecution timeMemory
934680tamyteParrots (IOI11_parrots)C++14
Compilation error
0 ms0 KiB
#include "decoder.h" #include "decoderlib.h" #include <vector> void decode(int N, int L, int X[]) { int i; std::vector<std::vector<int>> res(N, std::vector<int>(2, -1)); for(i=0; i<L; i++) { int num = 0; for (int j = (1 << 4); j <= X[i]; j <<= 1) { if (j & X[i]) { num += (j >> 4); } } int idx = 0; for (int j = 0; j < 4; ++j) { if ((1 << j) & X[i]) { idx += (1 << j); } } // std::cout << idx << " " << num << " <- " << X[i] << "\n"; if (res[idx][0] != -1) { if (res[idx][0] == num) { std::swap(res[idx][0], res[idx][1]); } } else { res[idx][0] = num; } } for (int i = 0; i < N; ++i) { if (res[i][0] == -1) res[i][0] = 0; if (res[i][1] == -1) res[i][1] = 0; int num = ((res[i][0] << 4) + res[i][1]); // std::cout << i << ": " << res[i][0] << " " << (res[i][1] << 4) << "\n"; output(num); } }

Compilation message (stderr)

/usr/bin/ld: /tmp/cclx11Es.o: in function `decode(int, int, int*)':
encoder.cpp:(.text+0x22e): undefined reference to `output(int)'
/usr/bin/ld: /tmp/ccwKep1q.o: in function `main':
grader_encoder.cpp:(.text.startup+0x162): undefined reference to `encode(int, int*)'
collect2: error: ld returned 1 exit status

/usr/bin/ld: /tmp/cc4i0sEd.o: in function `main':
grader_decoder.cpp:(.text.startup+0x1ef): undefined reference to `decode(int, int, int*)'
collect2: error: ld returned 1 exit status