# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
246111 | luisoncpp | Parrots (IOI11_parrots) | C++17 | 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 <algorithm>
#include <iostream>
#include <vector>
#include <cstdint>
#include <cstdlib>
#include <cassert>
#include <queue>
#include <unordered_map>
#include "encoder.h"
#include "encoderlib.h"
template<typename T>
using Vec = std::vector<T>;
void encode(int N, int* message) {
int out = 0;
for (int i = 0; i < N; ++i) {
if (message[i] == 1) {
out |= (1<<i);
}
}
send(out);
}
#include <algorithm>
#include <iostream>
#include <vector>
#include <cstdint>
#include <cstdlib>
#include <cassert>
#include <queue>
#include <unordered_map>
#include "encoder.h"
#include "encoderlib.h"
template<typename T>
using Vec = std::vector<T>;
void decode(int N, int L, int* X) {
int x = X[0];
for (int i = 0; i < N; ++i) {
if (x & (1<<i)) {
output(1);
} else {
output(0);
}
}
}