Submission #39243

#TimeUsernameProblemLanguageResultExecution timeMemory
39243steve11344Parrots (IOI11_parrots)C++14
52 / 100
5 ms2176 KiB
#include "encoder.h" #include "encoderlib.h" void encode(int N, int M[]) { int i; int priority=0; int message = 0; int mymaptbl[4] ={0xC0,0x30,0x0C,0x03}; for(i=0; i<N; i++){ message = 0; priority = i; for(int j = 0 ; j < 4; j++){ message |= priority<<4; message |= j<<2; message |= (M[i]&mymaptbl[j])>>(6-(2*j)); send(message); message = 0; } } return; }
#include "decoder.h" #include "decoderlib.h" void decode(int N, int L, int X[]) { int i, b,prio,place=0; int arr[32]={0,}; for(i=0; i<L; i++) { prio = X[i]; prio = prio>>4; place = (X[i]&0x0C)>>2; arr[prio] |= ((X[i]&0x03)<<(6-(2*place))); } for(int i = 0 ; i<N; i++) output(arr[i]); return; }

Compilation message (stderr)

decoder.cpp: In function 'void decode(int, int, int*)':
decoder.cpp:6:12: warning: unused variable 'b' [-Wunused-variable]
     int i, b,prio,place=0;
            ^
#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...