Submission #573192

#TimeUsernameProblemLanguageResultExecution timeMemory
573192TimDeeParrots (IOI11_parrots)C++14
Compilation error
0 ms0 KiB
void encode(int n, int message[]) { forn(i,n) { int x=message[i]; int a=x%4; send(a+i*64); x/=4; a=x%4; send(a+i*64+4); x/=4; a=x%4; send(a+i*64+8); x/=4; a=x%4; send(a+i*64+12); } }
void decode(int N, int L, int message[]) { int a[N]; forn(i,N) a[i]=0; forn(i,L) { int x=message[i]; int j=x/64; int k=(x/4)%4; int v=x%4; //cout<<"["<<j<<"] = "<<v<<' '<<k<<'\n'; if (k==0) { a[j]+=v; } else if (k==1) { a[j]+=v*4; } else if (k==2) { a[j]+=v*16; } else { a[j]+=v*64; } } forn(i,N) output(a[i]); }

Compilation message (stderr)

encoder.cpp: In function 'void encode(int, int*)':
encoder.cpp:2:10: error: 'i' was not declared in this scope
    2 |     forn(i,n) {
      |          ^
encoder.cpp:2:5: error: 'forn' was not declared in this scope
    2 |     forn(i,n) {
      |     ^~~~

decoder.cpp: In function 'void decode(int, int, int*)':
decoder.cpp:3:10: error: 'i' was not declared in this scope
    3 |     forn(i,N) a[i]=0;
      |          ^
decoder.cpp:3:5: error: 'forn' was not declared in this scope
    3 |     forn(i,N) a[i]=0;
      |     ^~~~
decoder.cpp:2:9: warning: unused variable 'a' [-Wunused-variable]
    2 |     int a[N];
      |         ^