#include <bits/stdc++.h>
using namespace std;
//#define int long long
#define pi pair<int, int>
#define pii pair<int, pi>
#define fi first
#define se second
#ifdef _WIN32
#define getchar_unlocked _getchar_nolock
#endif
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
#include "encoder.h"
#include "encoderlib.h"
void encode(int N, int M[])
{
if(N <= 32){
for(int i = 0; i < N; i++){
for(int j = 0; j < 8; j++){
if(M[i] >> j & 1){
send(i * 8 + j);
}
}
}
}
else{
for(int i = 0; i < N; i++){
for(int j = 0; j < 8; j++){
if(M[i] >> j & 1){
if(j >= 4){
send(i * 4 + j % 4);
send(i * 4 + j % 4);
}
else{
send(i * 4 + j % 4);
}
}
}
}
}
}
#include <bits/stdc++.h>
using namespace std;
//#define int long long
#define pi pair<int, int>
#define pii pair<int, pi>
#define fi first
#define se second
#ifdef _WIN32
#define getchar_unlocked _getchar_nolock
#endif
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
#include "decoder.h"
#include "decoderlib.h"
void decode(int N, int L, int X[])
{
int ans[300] = {0};
if(N <= 32){
for(int i = 0; i < L; i++){
int t = X[i] / 8, t1 = X[i] % 8;
ans[t] += (1<<t1);
}
for(int i = 0; i < N; i++)output(ans[i]);
}
else{
map <int, int> mp;
for(int i = 0; i < L; i++){
mp[X[i]]++;
}
for(auto [i, j] : mp){
int x = i / 4, y = i % 4;
if(j == 3){
ans[x] += (1<<y);
ans[x] += (1 << (y + 4));
}
else if(j == 2){
ans[x] += (1 << (y + 4));
}
else ans[x] += (1 << y);
}
for(int i = 0; i < N; i++)output(ans[i]);
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
780 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
1304 KB |
Output is correct |
2 |
Correct |
2 ms |
1316 KB |
Output is correct |
3 |
Correct |
2 ms |
1304 KB |
Output is correct |
4 |
Correct |
2 ms |
1320 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
1296 KB |
Output is correct |
2 |
Correct |
1 ms |
1308 KB |
Output is correct |
3 |
Correct |
2 ms |
1308 KB |
Output is correct |
4 |
Correct |
1 ms |
1320 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
1296 KB |
Output is correct |
2 |
Correct |
2 ms |
1316 KB |
Output is correct |
3 |
Correct |
2 ms |
1316 KB |
Output is correct |
4 |
Correct |
3 ms |
1332 KB |
Output is correct |
5 |
Correct |
2 ms |
1324 KB |
Output is correct |
6 |
Correct |
2 ms |
1336 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
1 ms |
1312 KB |
Output is partially correct - P = 8.000000 |
2 |
Partially correct |
3 ms |
1328 KB |
Output is partially correct - P = 8.000000 |
3 |
Partially correct |
4 ms |
1344 KB |
Output is partially correct - P = 12.000000 |
4 |
Partially correct |
8 ms |
1376 KB |
Output is partially correct - P = 12.000000 |
5 |
Partially correct |
8 ms |
1380 KB |
Output is partially correct - P = 12.000000 |
6 |
Partially correct |
9 ms |
1384 KB |
Output is partially correct - P = 12.000000 |
7 |
Partially correct |
8 ms |
1384 KB |
Output is partially correct - P = 12.000000 |