# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
500291 | aryan12 | 앵무새 (IOI11_parrots) | C++17 | 3 ms | 1048 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 "encoder.h"
#include "encoderlib.h"
#include <bits/stdc++.h>
using namespace std;
void encode(int N, int M[]) {
for(int i = 0; i < N; i++) {
vector<int> pos1;
int cnt1 = 0;
for(int j = 0; j < 9; j++) {
if((1 << j) & M[i]) {
cnt1++;
pos1.push_back(j);
}
}
int sent_num = 0;
sent_num += (8 * i);
for(int j = 0; j < pos1.size(); j++) {
send(sent_num + pos1[j]);
}
}
}
#include "decoder.h"
#include "decoderlib.h"
#include <bits/stdc++.h>
using namespace std;
void decode(int N, int L, int X[]) {
vector<int> one_bits[N];
for(int i = 0; i < L; i++) {
int cur_num = X[i];
int pos = cur_num / 8;
cur_num %= 8;
one_bits[pos].push_back(cur_num);
}
for(int i = 0; i < N; i++) {
int ans = 0;
for(int j = 0; j < one_bits[i].size(); j++) {
ans += (1 << one_bits[i][j]);
}
output(ans);
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |