Submission #26973

# Submission time Handle Problem Language Result Execution time Memory
26973 2017-07-08T02:28:31 Z grands Parrots (IOI11_parrots) C++14
17 / 100
11 ms 2400 KB
#include "encoder.h"
#include "encoderlib.h"

void encode(int N, int M[])
{
	int mask[8] = { 1,2,4,8,16,32,64,128 };
	for (int i = 0; i < N; i++){
		int message = M[i];
		int loc = i << 2;
		for (int m = 0; m < 8; m+=2){
			if (message&mask[m]){
				send(loc + m / 2);
			}
			if (message&mask[m+1]){
				send(loc + m / 2);
				send(loc + m / 2);
			}
		}
	}
}
#include "decoder.h"
#include "decoderlib.h"
void decode(int N, int L, int X[]){

	int M[64] = { 0 };
	for (int i = 0; i < L; i++){
		int message = X[i];
		int loc = message >> 2;
		M[loc] += 1<<(message % 4);
	}
	for (int i = 0; i < N; i++){
		output(M[i]);
	}
}
# Verdict Execution time Memory Grader output
1 Correct 4 ms 752 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 832 KB Error : Encoded message too long
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 1036 KB Error : Encoded message too long
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 1248 KB Error : Encoded message too long
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 2048 KB Error : Output is wrong
2 Incorrect 7 ms 2048 KB Error : Output is wrong
3 Incorrect 7 ms 2048 KB Error : Output is wrong
4 Incorrect 9 ms 2080 KB Error : Output is wrong
5 Incorrect 11 ms 2400 KB Error : Output is wrong
6 Incorrect 10 ms 2400 KB Error : Output is wrong
7 Incorrect 10 ms 2400 KB Error : Output is wrong