Submission #411547

#TimeUsernameProblemLanguageResultExecution timeMemory
411547LouayFarahParrots (IOI11_parrots)C++14
Compilation error
0 ms0 KiB
#include "bits/stdc++.h" #include "encoder.h" using namespace std; #define pb push_back vector<int> primes; void send(int a); void encode(int n, int m[]) { int nb = 2; while((int)primes.size()<32) { if(nb==2) primes.pb(nb); else { bool flag = true; for(int i = 2; i*i<=nb; i++) { if(nb%i==0) { flag = false; break; } } if(flag) primes.pb(nb); } nb++; } for(int i = 0; i<n; i++) { if(m[i]==0) { send(65535-i); continue; } string nb = bitset<8>(m[i]).to_string(); for(int pos = 1; pos<=8; pos++) { if(nb[8-pos]=='1') { send(primes[8+i]*(primes[pos-1])); } } } }

Compilation message (stderr)

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