Submission #926503

#TimeUsernameProblemLanguageResultExecution timeMemory
926503hotboy2703Parrots (IOI11_parrots)C++14
Compilation error
0 ms0 KiB
#include "decoder.h" #include "decoderlib.h" #include "encoder.h" #include "encoderlib.h" #include<bits/stdc++.h> using namespace std; const int maxn = 64; const int maxv = 256; int h[maxn][maxv]; int f[maxv], ans[maxn]; int ptr = 0; void init(){ memset(f, 0, sizeof(f)); memset(ans, 0, sizeof(ans)); ptr = 0; mt19937 rng(69); for(int i = 0; i < 64; i++){ for(int j = 0; j < 256; j++){ h[i][j] = j; } shuffle(h[i], h[i] + maxv, rng); } } void send_bit(int x){ // cout<<"SEND BIT "<<x<<' '<<ptr<<endl; if(x && ptr < maxv)send(ptr); else ptr++; } void encode(int N, int M[]) { init(); int cnt1 = 0; for(int i = 0; i < N; i++)cnt1 += __builtin_popcount(h[i][M[i]]); int sw = 0; if(cnt1 < N*4){ sw = 1; send_bit(0); } else send_bit(1); for(int i = 0; i < N; i++){ for(int j = 0; j < 8; j++){ send_bit((h[i][M[i]]>>j&1)^sw); } } }

Compilation message (stderr)

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