# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
73634 |
2018-08-28T15:53:24 Z |
Crown |
Parrots (IOI11_parrots) |
C++14 |
|
15 ms |
2664 KB |
#include "encoder.h"
#include "encoderlib.h"
#include <bits/stdc++.h>
using namespace std;
#define X first
#define Y second
#define pb push_back
typedef pair<int, int> ii;
typedef long long ll;
void encode(int n, int M[])
{
vector<int> mess;
for(int i = 0; i< n; i++)
{
int x = M[i];
vector<int> tmp;
for(int j = 0; j< 8; j++)
{
tmp.pb(((1<<j) & x)> 0);
}
reverse(tmp.begin(), tmp.end());
for(auto bit : tmp) mess.pb(bit);
}
// for(auto x : mess) printf("%d", x);
// printf("\n");
int k = mess.size();
for(int i = 0; 2*i< k; i++)
{
int base = i<<1;
int m1 = base;
m1 = base | mess[2*i];
send(m1);
if(mess[2*i+1]) send(m1);
}
}
#include "decoder.h"
#include "decoderlib.h"
#include <bits/stdc++.h>
using namespace std;
#define X first
#define Y second
#define pb push_back
typedef pair<int, int> ii;
typedef long long ll;
int fuck[10000][2];
void decode(int N, int L, int X[])
{
memset(fuck, 0, sizeof fuck);
for(int i = 0; i< L; i++)
{
fuck[X[i]>>1][X[i]&1]++;
}
vector<int> res;
for(int i = 0; i< 4*N; i++)
{
if(fuck[i][0]>= 1)
{
res.pb(0);
if(fuck[i][0] == 2) res.pb(1);
else res.pb(0);
}
else
{
res.pb(1);
if(fuck[i][1] == 2) res.pb(1);
else res.pb(0);
}
}
for(int st = 0; st< 8*N; st += 8)
{
int run = 0;
for(int i = 0; i< 8; i++)
{
run *= 2;
run += res[st+i];
}
output(run);
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
7 ms |
880 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
7 ms |
1720 KB |
Output is correct |
2 |
Correct |
7 ms |
1960 KB |
Output is correct |
3 |
Correct |
9 ms |
2256 KB |
Output is correct |
4 |
Correct |
9 ms |
2256 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
7 ms |
2256 KB |
Output is correct |
2 |
Correct |
7 ms |
2256 KB |
Output is correct |
3 |
Correct |
9 ms |
2264 KB |
Output is correct |
4 |
Correct |
8 ms |
2320 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
8 ms |
2320 KB |
Output is correct |
2 |
Correct |
9 ms |
2664 KB |
Output is correct |
3 |
Correct |
9 ms |
2664 KB |
Output is correct |
4 |
Correct |
11 ms |
2664 KB |
Output is correct |
5 |
Correct |
15 ms |
2664 KB |
Output is correct |
6 |
Correct |
10 ms |
2664 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
7 ms |
2664 KB |
Output is partially correct - P = 8.000000 |
2 |
Partially correct |
14 ms |
2664 KB |
Output is partially correct - P = 8.000000 |
3 |
Incorrect |
4 ms |
2664 KB |
Error : Bad encoded integer |
4 |
Incorrect |
4 ms |
2664 KB |
Error : Bad encoded integer |
5 |
Incorrect |
4 ms |
2664 KB |
Error : Bad encoded integer |
6 |
Incorrect |
4 ms |
2664 KB |
Error : Bad encoded integer |
7 |
Incorrect |
5 ms |
2664 KB |
Error : Bad encoded integer |