# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
73632 | Crown | 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 "decoder.h"
#include "decoderlib.h"
#include <bits/stdc++.h>
using namespace std;
#define X first
#define Y second
#define pb push_back
typedef pair<int, int> ii;
typedef long long ll;
int fuck[10000][2];
void decode(int N, int L, int X[])
{
memset(fuck, 0, sizeof fuck);
for(int i = 0; i< L; i++)
{
fuck[X[i]>>1][X[i]&1]++;
}
vector<int> res;
for(int i = 0; i< 4*N; i++)
{
if(fuck[i][0]>= 1)
{
res.pb(0);
if(fuck[i][0] == 2) res.pb(1);
else res.pb(0);
}
else
{
res.pb(1);
if(fuck[i][1] == 2) res.pb(1);
else res.pb(0);
}
}
// for(auto x : res) printf("%d", x);
// printf("\n");
for(int st = 0; st< 8*N; st += 8)
{
int run = 0;
for(int i = 0; i< 8; i++)
{
run *= 2;
run += res[st+i];
}
output(run);
// printf("%d ", run);
}
// printf("\n");
}
#include "decoder.h"
#include "decoderlib.h"
#include <bits/stdc++.h>
using namespace std;
#define X first
#define Y second
#define pb push_back
typedef pair<int, int> ii;
typedef long long ll;
int fuck[10000][2];
void decode(int N, int L, int X[])
{
memset(fuck, 0, sizeof fuck);
for(int i = 0; i< L; i++)
{
fuck[X[i]>>1][X[i]&1]++;
}
vector<int> res;
for(int i = 0; i< 4*N; i++)
{
if(fuck[i][0]>= 1)
{
res.pb(0);
if(fuck[i][0] == 2) res.pb(1);
else res.pb(0);
}
else
{
res.pb(1);
if(fuck[i][1] == 2) res.pb(1);
else res.pb(0);
}
}
for(int st = 0; st< 8*N; st += 8)
{
int run = 0;
for(int i = 0; i< 8; i++)
{
run *= 2;
run += res[st+i];
}
output(run);
}
}