# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
799323 |
2023-07-31T12:38:33 Z |
Liudas |
Parrots (IOI11_parrots) |
C++17 |
|
22 ms |
1804 KB |
#include <bits/stdc++.h>
#include "encoder.h"
#include "encoderlib.h"
//#include "decoder.h"
//#include "decoderlib.h"
using namespace std;
void encode(int N, int M[]){
for(int i = 0; i < N; i ++){
int t = M[i];
int a = t % 4, b = t / 4 % 4, c = t / 16 % 4, d = t / 64 % 4;
int aa = i % 16 * 4 * 4, bb = (i % 16 * 4 + 1) * 4, cc = (i % 16 * 4 + 2) * 4, dd = (i % 16 * 4 + 3) * 4;
send(aa + a);
send(bb + b);
send(cc + c);
send(dd + d);
if(i > 15){
send(aa + a);
send(bb + b);
send(cc + c);
send(dd + d);
}
if(i > 31){
send(aa + a);
send(bb + b);
send(cc + c);
send(dd + d);
send(aa + a);
send(bb + b);
send(cc + c);
send(dd + d);
}
if(i > 47){
send(aa + a);
send(bb + b);
send(cc + c);
send(dd + d);
send(aa + a);
send(bb + b);
send(cc + c);
send(dd + d);
send(aa + a);
send(bb + b);
send(cc + c);
send(dd + d);
send(aa + a);
send(bb + b);
send(cc + c);
send(dd + d);
}
}
}
#include <bits/stdc++.h>
//#include "encoder.h"
//#include "encoderlib.h"
#include "decoder.h"
#include "decoderlib.h"
using namespace std;
void decode(int N, int L, int X[]){
map<int, int> arr;
for(int i = 0; i < L; i++){
arr[X[i]]++;
}
vector<int> left[4], ans(N), ord;
for(auto[l, r] : arr){
for(int i = 0; i < 4; i++){
if((r & (1 << i))){
left[i].push_back(l);
}
}
}
for(int i = 0; i < 4; i++){
for(int j : left[i]){
ord.push_back(j);
}
}
for(int i = 0; i < N; i ++){
int a = ord[i * 4] % 4 + ord[i * 4 + 1] % 4 * 4 + ord[i * 4 + 2] % 4 * 16 + ord[i * 4 + 3] % 4 * 64;
output(a);
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
644 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
1008 KB |
Output is correct |
2 |
Correct |
2 ms |
1004 KB |
Output is correct |
3 |
Correct |
3 ms |
1040 KB |
Output is correct |
4 |
Correct |
2 ms |
1048 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
1040 KB |
Output is correct |
2 |
Correct |
2 ms |
1040 KB |
Output is correct |
3 |
Correct |
2 ms |
1040 KB |
Output is correct |
4 |
Correct |
2 ms |
1044 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
1040 KB |
Output is correct |
2 |
Correct |
2 ms |
1008 KB |
Output is correct |
3 |
Correct |
2 ms |
1044 KB |
Output is correct |
4 |
Correct |
3 ms |
1192 KB |
Output is correct |
5 |
Correct |
5 ms |
1204 KB |
Output is correct |
6 |
Correct |
5 ms |
1292 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
1040 KB |
Output is correct - P = 4.000000 |
2 |
Partially correct |
4 ms |
1292 KB |
Output is partially correct - P = 6.000000 |
3 |
Partially correct |
5 ms |
1208 KB |
Output is partially correct - P = 6.303030 |
4 |
Partially correct |
11 ms |
1476 KB |
Output is partially correct - P = 10.240000 |
5 |
Partially correct |
21 ms |
1684 KB |
Output is partially correct - P = 13.866667 |
6 |
Partially correct |
22 ms |
1780 KB |
Output is partially correct - P = 14.730159 |
7 |
Partially correct |
22 ms |
1804 KB |
Output is partially correct - P = 15.000000 |