Submission #262245

#TimeUsernameProblemLanguageResultExecution timeMemory
262245nandonathanielParrots (IOI11_parrots)C++14
Compilation error
0 ms0 KiB
#include "encoder.h" #include "bits/stdc++.h" using namespace std; void encode(int N, int M[]) { int satu=0,nol=0; for(int i=0;i<N;i++){ for(int j=0;j<8;j++){ if((1<<j) & M[i])satu++; else nol++; } } if(satu<nol){ for(int i=0;i<N;i++){ for(int j=0;j<8;j++){ if((1<<j) & M[i])send(j*N+i); } } } else{ send(0);send(0); for(int i=0;i<N;i++){ for(int j=0;j<8;j++){ if(!((1<<j) & M[i]))send(j*N+i); } } } }
#include "decoder.h" #include "bits/stdc++.h" using namespace std; int ans[16],byk[256]; void decode(int N, int L, int X[]) { memset(byk,0,sizeof(byk)); for(int i=0;i<L;i++)byk[X[i]]++; memset(ans,0,sizeof(ans)); if(byk[0]>1){ //kita masukkinnya yang mati for(int i=0;i<256;i++){ if(byk[i])ans[i%N]+=(1<<(i/N)); } for(int i=0;i<N;i++)ans[i]=255-ans[i]; } else{ for(int i=0;i<256;i++){ if(byk[i])ans[i%N]+=(1<<(i/N)); } } for(int i=0;i<N;i++)output(ans[i]); }

Compilation message (stderr)

encoder.cpp: In function 'void encode(int, int*)':
encoder.cpp:16:22: error: 'send' was not declared in this scope
   16 |     if((1<<j) & M[i])send(j*N+i);
      |                      ^~~~
encoder.cpp:21:3: error: 'send' was not declared in this scope
   21 |   send(0);send(0);
      |   ^~~~

decoder.cpp: In function 'void decode(int, int, int*)':
decoder.cpp:22:22: error: 'output' was not declared in this scope
   22 |  for(int i=0;i<N;i++)output(ans[i]);
      |                      ^~~~~~