# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
595958 |
2022-07-14T08:20:41 Z |
proma |
Parrots (IOI11_parrots) |
C++17 |
|
5 ms |
1264 KB |
#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 ++) {
bitset<8>bs(M[i]);
for (int j = 0; j < 8; j ++) {
if (bs[j]) {
int x = j;
int pos = i;
for (int k = 3; k < 8; k ++) {
x += (pos % 2) * (1 << k);
pos /= 2;
}
send(x);
}
}
}
}
#include "decoder.h"
#include "decoderlib.h"
#include <bits/stdc++.h>
using namespace std;
void decode(int N, int L, int X[]) {
vector <int> res(N);
for (int i = 0; i < L; i ++) {
bitset<8>bs(X[i]);
int whichBit = 0;
for (int j = 0; j < 3; j ++) {
whichBit += bs[j] * (1 << j);
}
int pos = 0;
for (int j = 3; j < 8; j ++) {
pos += bs[j] * (1 << (j - 3));
}
res[pos] += (1 << whichBit);
}
for (auto i: res) {
// std::cout << i << " ";
output(i);
}// std::cout << std::endl;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
652 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
1012 KB |
Output is correct |
2 |
Correct |
2 ms |
1044 KB |
Output is correct |
3 |
Correct |
2 ms |
1044 KB |
Output is correct |
4 |
Correct |
2 ms |
1040 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
1044 KB |
Output is correct |
2 |
Correct |
2 ms |
1048 KB |
Output is correct |
3 |
Correct |
2 ms |
1012 KB |
Output is correct |
4 |
Correct |
2 ms |
1048 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
1032 KB |
Output is correct |
2 |
Correct |
3 ms |
1048 KB |
Output is correct |
3 |
Correct |
3 ms |
1040 KB |
Output is correct |
4 |
Correct |
3 ms |
1064 KB |
Output is correct |
5 |
Correct |
4 ms |
1056 KB |
Output is correct |
6 |
Correct |
3 ms |
1060 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
2 ms |
1048 KB |
Output is partially correct - P = 8.000000 |
2 |
Partially correct |
3 ms |
1068 KB |
Output is partially correct - P = 8.000000 |
3 |
Incorrect |
3 ms |
1068 KB |
Error : Output is wrong |
4 |
Incorrect |
3 ms |
1076 KB |
Error : Output is wrong |
5 |
Incorrect |
5 ms |
1264 KB |
Error : Output is wrong |
6 |
Incorrect |
5 ms |
1172 KB |
Error : Output is wrong |
7 |
Incorrect |
4 ms |
1096 KB |
Error : Output is wrong |