| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1332412 | QuocSensei | Parrots (IOI11_parrots) | C++20 | 0 ms | 0 KiB |
#include <bits/stdc++.h>
#define ll long long
#define el cout << endl
#define bit(mask, i) (((mask) >> (i)) & 1)
#define BIT(n) ((1ll) << (n))
using namespace std;
void send(int a);
void output(int b);
namespace SUBTASK_1
{
namespace personA
{
void encode(int N, int M[])
{
int a = 0;
for (int i = 0; i < N; i++)
a += M[i] * BIT(i);
send(a);
}
}
namespace personB
{
void decode(int N, int L, int X[])
{
for (int i = 0; i < N; i++)
output(bit(X[0], i));
}
}
}
void encode(int N, int M[])
{
SUBTASK_1::personA::encode(N, M);
}
void decode(int N, int L, int X[])
{
SUBTASK_1::personB::decode(N, L, X);
}#include <bits/stdc++.h>
#define ll long long
#define el cout << endl
#define bit(mask, i) (((mask) >> (i)) & 1)
#define BIT(n) ((1ll) << (n))
using namespace std;
void send(int a);
void output(int b);
namespace SUBTASK_1
{
namespace personA
{
void encode(int N, int M[])
{
int a = 0;
for (int i = 0; i < N; i++)
a += M[i] * BIT(i);
send(a);
}
}
namespace personB
{
void decode(int N, int L, int X[])
{
for (int i = 0; i < N; i++)
output(bit(X[0], i));
}
}
}
void encode(int N, int M[])
{
SUBTASK_1::personA::encode(N, M);
}
void decode(int N, int L, int X[])
{
SUBTASK_1::personB::decode(N, L, X);
}