| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1369298 | mohammadyay | 앵무새 (IOI11_parrots) | C++20 | 0 ms | 0 KiB |
#include "../../Downloads/parrots/parrots/encoder.h"
#include "../../Downloads/parrots/parrots/encoderlib.h"
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
using ll = long long;
#define pb push_back
#define eb emplace_back
#define pF first
#define pS second
#define SP << " " <<
ll a[40];
void encode(int N, int M[]) {
ll n = N;
for (int i = 0; i < n; i++) a[i] = M[i];
for (int i = 0 ; i < n; i++) {
ll k = 7, x = a[i];
while (x > 0) {
if (x >= (1<<k)) {
send(i * 8 + k);
x -= (1<<k);
}
k--;
}
}
}
#include "../../Downloads/parrots/parrots/decoder.h"
#include "../../Downloads/parrots/parrots/decoderlib.h"
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
using ll = long long;
#define pb push_back
#define eb emplace_back
#define pF first
#define pS second
#define SP << " " <<
ll a[40];
bool b[300];
/** void encode(int N, int M[]) {
ll n = N;
for (int i = 0; i < n; i++) a[i] = M[i];
for (int i = 0 ; i < n; i++) {
ll k = 7, x = a[i];
while (x > 0) {
if (x >= (1<<k)) {
send(i * 8 + k);
x -= (1<<k);
}
k--;
}
}
}
*/
void decode(int N, int L, int X[]) {
ll n = N, l = L;
for (int i = 0; i < n; i++) a[i] = X[i];
for (int i=0; i < n * 8; i++) b[i] = 0;
for (auto i : a) b[i] = 1;
ll ans;
for (int i=0; i < n * 8; i++) {
if (i && i % 8 == 0) {
ans = 0;
output(ans);
}
ans += (a[i] ? (1<<(i%8)) : 0);
}
output(ans);
}
