Submission #18709

#TimeUsernameProblemLanguageResultExecution timeMemory
18709ggohParrots (IOI11_parrots)C++98
17 / 100
13 ms2168 KiB
#include "encoder.h" #include "encoderlib.h" void encode(int N,int M[]) { int t=0,u=0,st[1002],stt[1002]; for(int i=0;i<N;i++) { for(int j=0;j<M[i]/64;j++)st[t++]=i*4; for(int j=0;j<M[i]%64/16;j++)st[t++]=i*4+1; for(int j=0;j<M[i]%16/4;j++)st[t++]=i*4+2; for(int j=0;j<M[i]%4;j++)st[t++]=i*4+3; for(int j=0;j<3-M[i]/64;j++)stt[u++]=i*4; for(int j=0;j<3-M[i]%64/16;j++)stt[u++]=i*4+1; for(int j=0;j<3-M[i]%16/4;j++)stt[u++]=i*4+2; for(int j=0;j<3-M[i]%4;j++)stt[u++]=i*4+3; } if(t<=6*N) { for(int i=0;i<t;i++)send(st[i]); } else { for(int i=0;i<u;i++)send(stt[i]); } }
#include "decoder.h" #include "decoderlib.h" void decode(int N,int L,int X[]) { int ch[256]={}; for(int i=0;i<L;i++)ch[X[i]]++; if(L<=6*N) { for(int i=0;i<N;i++) { output(ch[i*4]*64+ch[i*4+1]*16+ch[i*4+2]*4+ch[i*4+3]); } } else { for(int i=0;i<N;i++) { output((3-ch[i*4])*64+(3-ch[i*4+1])*16+(3-ch[i*4+2])*4+(3-ch[i*4+3])); } } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...