# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
122991 | CaroLinda | Parrots (IOI11_parrots) | C++14 | 0 ms | 0 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 <bits/stdc++.h>
#include "encoder.h"
#include "encoderlib.h"
#define lp(i,a,b) for(int i=a;i<b;i++)
#define MAX 70
using namespace std;
int qtd[8] = {1,2,1,2,1,2,1,2} ;
void encode(int n , int m[] )
{
lp(i,0,n)
lp(j,0,8)
if( (m[i] & (1<<j) ) != 0 )
lp(k,0,qtd[j]) send(8*i+j-j%2) ;
}
#include <bits/stdc++.h>
#include "encoder.h"
#include "encoderlib.h"
#define lp(i,a,b) for(int i=a;i<b;i++)
#define MAX 70
using namespace std;
void decode(int n , int l , int x[])
{
int seq[MAX] ;
lp(i,0,n) seq[i] = 0 ;
lp(i,0,l)
seq[ x[i]/8 ] += (1<<(x[i]%8)) ;
lp(i,0,n) output(seq[i]) ;
}