Submission #573295

#TimeUsernameProblemLanguageResultExecution timeMemory
573295TimDeeParrots (IOI11_parrots)C++14
Compilation error
0 ms0 KiB
#include "encoder.h" #include "encoderlib.h" #define forn(i,n) for (int i=0; i<n; i++) void encode(int n, int message[]) { forn(i,n) { int x=message[i]; int add=i*8; int a=x%4; if (a==0) { send(add); } else if (a==1) { send(1+add); } else if (a==2) { send(1+add); send(1+add); } else { send(add); send(add); } x/=4; a=x%4; if (a==0) { send(add+2); } else if (a==1) { send(1+add+2); } else if (a==2) { send(1+add+2); send(1+add+2); } else { send(add+2); send(add+2); } x/=4; a=x%4; if (a==0) { send(add+4); } else if (a==1) { send(1+add+4); } else if (a==2) { send(1+add+4); send(1+add+4); } else { send(add+4); send(add+4); } x/=4; a=x%4; if (a==0) { send(add+6); } else if (a==1) { send(1+add+6); } else if (a==2) { send(1+add+6); send(1+add+6); } else { send(add+6); send(add+6); } x/=4; } }
#include "decoder.h" #include "decoderlib.h" #define forn(i,n) for (int i=0; i<n; i++) struct node { int fz=0,fo=0,sz=0,so=0,tz=0,to=0,pz=0,po=0; }; void decode(int N, int L, int message[]) { int a[N]; node v[N]; forn(i,N) a[i]=0; forn(i,L) { int x=message[i]; int j=x/8; int k=(x/2)%4; if (k==0) { if (x%2) v[j].fo++; else v[j].fz++; } else if (k==1) { if (x%2) v[j].so++; else v[j].sz++; } else if (k==2) { if (x%2) v[j].to++; else v[j].tz++; } else { if (x%2) v[j].po++; else v[j].pz++; } } forn(i,N) { cout<<"#"<<i<<": "; int fo=v[i].fo, fz=v[i].fz; if (fo==2) { a[i]+=2; } else if (fo==1) { a[i]+=1; } else if (fz==2) { a[i]+=3; } int so=v[i].so, sz=v[i].sz; if (so==2) { a[i]+=2*4; } else if (so==1) { a[i]+=1*4; } else if (sz==2) { a[i]+=3*4; } int to=v[i].to, tz=v[i].tz; if (to==2) { a[i]+=2*16; } else if (to==1) { a[i]+=1*16; } else if (tz==2) { a[i]+=3*16; } int po=v[i].po, pz=v[i].pz; if (po==2) { a[i]+=2*64; } else if (po==1) { a[i]+=1*64; } else if (pz==2) { a[i]+=3*64; } //cout<<fo<<' '<<fz<<' '<<so<<' '<<sz<<' '<<to<<' '<<tz<<' '<<po<<' '<<pz<<' '; output(a[i]); } }

Compilation message (stderr)

decoder.cpp: In function 'void decode(int, int, int*)':
decoder.cpp:32:9: error: 'cout' was not declared in this scope
   32 |         cout<<"#"<<i<<": ";
      |         ^~~~