Submission #568393

#TimeUsernameProblemLanguageResultExecution timeMemory
568393AndrejSh3Parrots (IOI11_parrots)C++17
17 / 100
3 ms1064 KiB
#include<bits/stdc++.h> #include"encoder.h" #include"encoderlib.h" /* Strategy: *) Encoder: Encoder will send the following number: xxxy Where xxx is the binary representation of i Where y is the value of M[i] *) Decoder: Decoder will take the given numbers xxxy and create an array with the original message */ int sendValue( int i, int Mi ){ int rv = i; rv <<= 1; rv |= Mi; return rv; } void encode( int N, int M[] ){ for( int i = 0 ; i < N ; i++ ){ send( sendValue( i, M[i] ) ); } }
#include<bits/stdc++.h> #include"decoder.h" #include"decoderlib.h" /* Strategy: *) Encoder: Encoder will send the following number: xxxy Where xxx is the binary representation of i Where y is the value of M[i] *) Decoder: Decoder will take the given numbers xxxy and create an array with the original message */ void recieveValue( int Xi, int &x, int &y ){ y = Xi & 1; Xi >>= 1; x = Xi; } void decode( int N, int L, int X[] ){ int A[N] = {}; int x, y; for( int i = 0 ; i < L ; i++ ){ recieveValue( X[i], x, y ); A[x] = y; } for( int i = 0 ; i < N ; i++ ) output(A[i]); }
#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...