# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
228030 | muhammad_hokimiyon | Parrots (IOI11_parrots) | C++14 | 21 ms | 2048 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>
#define fi first
#define se second
#define ll long long
#define dl double long
using namespace std;
void encode(int n, int a[])
{
for( int i = 0; i < n; i++ ){
for( int j = 0; j < 4; j++ ){
int x = i;
for( int h = 6; h < 8; h++ ){
if( ( (a[i] >> (j * 2 + h - 6)) & 1) ){
x += (1 << h);
}
}
for( int g = 0; g <= j; g++ ){
send( x );
}
}
}
}
#include "decoder.h"
#include "decoderlib.h"
#include <bits/stdc++.h>
#define fi first
#define se second
#define ll long long
#define dl double long
using namespace std;
void decode(int n, int l, int a[])
{
map < int , int > m;
for( int i = 0; i < l; i++ ){
m[a[i]] += 1;
}
vector < int > ans(n , 0);
for( auto x : m ){
int p = 0;
for( int j = 0; j < 6; j++ ){
if( (x.fi & (1 << j)) )p |= (1 << j);
}
int val = 0;
for( int j = 0; j < 2; j++ ){
if( (( x.fi >> (6 + j) ) & 1) ){
ans[p] |= (1 << ((x.se - 1) * 2 + j) );
}
}
}
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... |