Submission #600061

#TimeUsernameProblemLanguageResultExecution timeMemory
600061Mr_HusanboyParrots (IOI11_parrots)C++14
81 / 100
7 ms1304 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]^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); int ind=0; 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^ind)); // cout<<(res^ind)<<'\n'; ind++; } }
#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...