# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
899923 | ar88lo | Parrots (IOI11_parrots) | C++14 | 3 ms | 1336 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[]){
int ind = 0;
for(int i = N-1; i >= 0; i--){
for(int j = 0; j < 8; j++){
if((M[i] >> j) & 1){
send(ind);
//cout<<ind<<"kh\n";
}
ind++;
}
}
}
#include "decoder.h"
#include "decoderlib.h"
#include <bits/stdc++.h>
using namespace std;
void decode(int N, int L, int X[]){
int a[8192];
memset(a, 0, sizeof a);
for(int i = 0; i < L; i++){
int ind = X[i];
a[ind] = 1;
}
int cur = 0;
int cnt = 0;
vector<int> ret;
for(int i = 0; i < 8192; i++){
if(a[i] == 1){
//cout<<i<<" "<<cnt<<'\n';
cur = (cur | (1<<cnt));
}
cnt++;
if(cnt == 8){
//cout<<cur<<"kh2\n";
ret.push_back(cur);
cnt = 0;
cur = 0;
}
if(ret.size() == N) break;
}
reverse(ret.begin(), ret.end());
for(int i = 0; i < N; i++){
output(ret[i]);
}
}
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... |