This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "encoder.h"
#include "encoderlib.h"
int append( int x, int i ){
return 100*x+i;
}
void encode( int N, int M[] ){
/* IDEA 1 :
For every number Mi, add to it two digits that identify the order index
*/
for(int i=0;i<N;i++) send( append( M[i], i ) );
}
#include "decoder.h"
#include "decoderlib.h"
void decode(int N, int L, int X[]){
/* IDEA 1 :
X has N numbers, each number is xyz, where x is the original number and yz is the index
*/
int A[L];
for(int i=0;i<L;i++){
int xyz = X[i];
int x = X[i] / 100, yz = X[i]%100;
A[yz] = x;
}
for(int i=0;i<L;i++) output( A[i] );
}
Compilation message (stderr)
decoder.cpp: In function 'void decode(int, int, int*)':
decoder.cpp:13:7: warning: unused variable 'xyz' [-Wunused-variable]
int xyz = X[i];
^~~
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |