# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
61087 |
2018-07-25T07:50:49 Z |
mhnd |
Parrots (IOI11_parrots) |
C++14 |
|
15 ms |
2784 KB |
#include "encoder.h"
#include "encoderlib.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const int N = 1e5+50;
const ll oo = 1e18;
const ll mod = 1e9+7;
void encode(int N, int M[]) {
if(N<=32){
for(int i=0;i<N;i++)
for(int k=0;k<8;k++)
if((M[i]>>k)&1)send(N*k+i);
}else{
for(int i=0;i<32;i++){
for(int k=0;k<8;k++){
if(i+32<N){
if((M[i]>>k)&1 && (M[i+32]>>k)){
send(8*i+k);
send(8*i+k);
}else if((M[i+32]>>k)&1){
send(8*i+k);
send(8*i+k);
send(8*i+k);
}else if((M[i]>>k)&1)send(8*i+k);
}else if((M[i]>>k)&1)send(8*i+k);
}
}
}
}
#include "decoder.h"
#include "decoderlib.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const int N = 1e5+50;
const ll oo = 1e18;
const ll mod = 1e9+7;
int num[65],f[256];
void decode(int N, int L, int X[]){
memset(num,0,sizeof(num));
memset(f,0,sizeof(f));
if(N<=32){
for(int i=0;i<L;i++)num[X[i]%N] += (1<<(X[i]/N));
}else{
for(int i=0;i<L;i++)f[X[i]]++;
for(int i=0;i<L;i++){
if(f[X[i]]==3){
num[X[i]/8+32] |= (1<<(i%8));
}else if(f[X[i]]==2){
num[X[i]/8] |= (1<<(i%8));
num[(X[i]/8)+32] |= (1<<(i%8));
}else num[X[i]/8] |= (1<<(i%8));
}
}
for(int i=0;i<N;i++)output(num[i]);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
752 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
7 ms |
1960 KB |
Output is correct |
2 |
Correct |
7 ms |
1960 KB |
Output is correct |
3 |
Correct |
8 ms |
2056 KB |
Output is correct |
4 |
Correct |
8 ms |
2088 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
2216 KB |
Output is correct |
2 |
Correct |
7 ms |
2248 KB |
Output is correct |
3 |
Correct |
7 ms |
2248 KB |
Output is correct |
4 |
Correct |
5 ms |
2248 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
7 ms |
2248 KB |
Output is correct |
2 |
Correct |
8 ms |
2248 KB |
Output is correct |
3 |
Correct |
10 ms |
2272 KB |
Output is correct |
4 |
Correct |
9 ms |
2272 KB |
Output is correct |
5 |
Correct |
10 ms |
2272 KB |
Output is correct |
6 |
Correct |
8 ms |
2272 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
8 ms |
2272 KB |
Output is partially correct - P = 8.000000 |
2 |
Partially correct |
7 ms |
2272 KB |
Output is partially correct - P = 8.000000 |
3 |
Incorrect |
8 ms |
2272 KB |
Error : Output is wrong |
4 |
Incorrect |
12 ms |
2528 KB |
Error : Output is wrong |
5 |
Incorrect |
12 ms |
2536 KB |
Error : Output is wrong |
6 |
Incorrect |
15 ms |
2784 KB |
Error : Output is wrong |
7 |
Incorrect |
12 ms |
2784 KB |
Error : Output is wrong |