# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
227732 | muhammad_hokimiyon | Parrots (IOI11_parrots) | C++14 | 11 ms | 1632 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 encode(int n, int a[])
{
for( int i = 0; i < n; i++ ){
for( int j = 0; j < 4; j++ ){
int res = i;
res += (j << 4);
for( int h = 6; h < 8; h++ ){
if( ((a[i] >> (j * 2 + h - 6)) & 1) ){
res += (1 << h);
}
}
send( res );
}
}
}
#include "decoder.h"
#include "decoderlib.h"
#include <bits/stdc++.h>
using namespace std;
void decode(int n, int l, int a[])
{
vector < vector < int > > b(n , vector < int > (4));
for( int i = 0; i < l; i++ ){
int x = 0;
for( int j = 0; j < 4; j++ ){
if( ((a[i] >> j) & 1) ){
x ^= (1 << j);
}
}
int y = 0;
for( int j = 4 , h = 0; j < 6; j++,h++ ){
int z = ((a[i] >> j) & 1);
if( z )y ^= (1 << h);
}
int z = 0;
for( int j = 6 , h = 0; j < 8; j++,h++ ){
if( ((a[i] >> j) & 1) )z ^= (1 << h);
}
b[x][y] = z;
}
for( int i = 0; i < n; i++ ){
int x = 0;
for( int j = 0 , h = 0; j < 4; j++ ){
x ^= (b[i][j] << (j * 2));
}
output( x );
}
}
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... |