# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
235313 | DavidDamian | Parrots (IOI11_parrots) | C++11 | 13 ms | 1792 KiB |
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"
#include<bits/stdc++.h>
using namespace std;
void printBinary(int n)
{
for(int i=0;i<8;i++){
cout<<((n&(1<<i))? 1 : 0);
}
cout<<endl;
}
void encode(int N, int M[])
{
for(int i=0;i<N;i++){
int number=i;
for(int j=0;j<4;j++){
number=i;
int binary_pos=j;
binary_pos=(binary_pos<<4);
number|=binary_pos;
int aux=(1<<((j+1)*2))-1;
aux=aux-((1<<((j)*2))-1);
int segment=(M[i]&aux);
segment=(segment>>(j*2));
segment=(segment<<6);
number|=segment;
send(number);
}
}
}
#include "decoder.h"
#include "decoderlib.h"
#include<bits/stdc++.h>
using namespace std;
void decode(int N, int L, int X[])
{
vector<int> ans(N);
for(int i=0;i<L;i++){
int idx=(X[i]%16);
X[i]=(X[i]>>4);
int part=X[i]%4;
X[i]=(X[i]>>2);
int x=X[i]<<(part*2);
ans[idx]+=(X[i]<<(part*2));
}
for(int i=0;i<N;i++){
output(ans[i]);
}
}
Compilation message (stderr)
# | 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... |