#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);
}
}
}
#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, right, ans(N), brr;
for(auto[l, r] : arr){
if(r % 2){
left.push_back(l);
}
if(r > 1){
right.push_back(l);
}
}
vector<int> ord = left;
for(int i: right){
ord.push_back(i);
}
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);
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
640 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
1028 KB |
Output is correct |
2 |
Correct |
2 ms |
1032 KB |
Output is correct |
3 |
Correct |
2 ms |
1036 KB |
Output is correct |
4 |
Correct |
2 ms |
1044 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
1036 KB |
Output is correct |
2 |
Correct |
3 ms |
1032 KB |
Output is correct |
3 |
Correct |
2 ms |
1036 KB |
Output is correct |
4 |
Correct |
2 ms |
1096 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
1028 KB |
Output is correct |
2 |
Correct |
3 ms |
1056 KB |
Output is correct |
3 |
Correct |
2 ms |
1040 KB |
Output is correct |
4 |
Correct |
3 ms |
1160 KB |
Output is correct |
5 |
Correct |
4 ms |
1204 KB |
Output is correct |
6 |
Correct |
3 ms |
1204 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
1036 KB |
Output is correct - P = 4.000000 |
2 |
Partially correct |
4 ms |
1196 KB |
Output is partially correct - P = 6.000000 |
3 |
Incorrect |
3 ms |
1064 KB |
Error : Output is wrong |
4 |
Incorrect |
5 ms |
1228 KB |
Error : Output is wrong |
5 |
Incorrect |
6 ms |
1244 KB |
Error : Output is wrong |
6 |
Incorrect |
8 ms |
1236 KB |
Error : Output is wrong |
7 |
Incorrect |
8 ms |
1232 KB |
Error : Output is wrong |