Submission #600049

#TimeUsernameProblemLanguageResultExecution timeMemory
600049Mr_HusanboyParrots (IOI11_parrots)C++14
52 / 100
5 ms1284 KiB
#include "encoder.h" #include "encoderlib.h" #include <bits/stdc++.h> using namespace std; void encode(int n, int m[]) { int bit=0; for(int i=0;i<n;i++){ for(int j=0;j<8;j++){ if(m[i]&(1<<j)){ bit++; } send(bit); } } // cout<<bit<<endl; }
#include "decoder.h" #include "decoderlib.h" #include <bits/stdc++.h> using namespace std; void decode(int n, int l, int bit[]) { sort(bit,bit+l); for(int i=0;i<l;i+=8){ int res=0; for(int j=i;j<i+8;j++){ if(j==0){ res+=bit[i]; }else{ if(bit[j] - bit[j-1]){ res+=(1<<(j-i)); } } } output(res); } }
#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...