Submission #235562

#TimeUsernameProblemLanguageResultExecution timeMemory
235562DavidDamianParrots (IOI11_parrots)C++11
81 / 100
12 ms1536 KiB
#include "encoder.h" #include "encoderlib.h" #include<bits/stdc++.h> using namespace std; ///Subtask 4 ///Represent the numbers as a binary string and send positions of 1's void encode(int N, int M[]) { int idx=0; for(int i=0;i<N;i++){ for(int bit=0;bit<8;bit++){ if(M[i]&(1<<bit)) send(idx+bit); } idx+=8; } }
#include "decoder.h" #include "decoderlib.h" #include<bits/stdc++.h> using namespace std; ///Subtask 4 ///Represent the numbers as a binary string and send positions of 1's void decode(int N, int L, int X[]) { vector<int> binary(8*N,0); sort(X,X+L); for(int i=0;i<L;i++){ binary[X[i]]=1; } for(int i=0;i<8*N;i+=8){ int number=0; for(int bit=0;bit<8;bit++){ if(binary[i+bit]) number+=(1<<bit); } output(number); } }
#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...