답안 #958635

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
958635 2024-04-06T09:15:11 Z Tyx2019 앵무새 (IOI11_parrots) C++17
0 / 100
1 ms 1316 KB
#include "encoder.h"
#include "encoderlib.h"
#include <iostream>
void encode(int N, int M[])
{	
	int len = 0;
	for(int i=0;i<N;i++){
		int a = M[i];
		for(int k=0;k<8;k++){
			int b = a % 2;
			a /= 2;
			for(int j = 0;j < b;j++){
				len++;
				send(i * 4 + k);
				//std::cout << i * 8 + k << " ";
			}
		}
	}
	//std::cout << "LEN IS " << len << '\n';
}

#include "decoder.h"
#include "decoderlib.h"
#include <bits/stdc++.h>
using namespace std;
void decode(int N, int L, int X[])
{
	int cnt[8 * N];
	memset(cnt, 0, sizeof(cnt));
	for(int i=0;i<L;i++){
		cnt[X[i]]++;
	}
	int M[N];
	int grr[] = {1, 2, 4, 8, 16, 32, 64, 128};
	for(int i=0;i<N;i++){
		M[i] = 0;
		for(int j=8*i;j<8*i+8;j++){
			M[i] += cnt[j] * (grr[j - 8*i]);
		}
		output(M[i]);
		//cout << M[i] << " ";
	}
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 796 KB Error : Output is wrong
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 1312 KB Error : Output is wrong
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 1312 KB Error : Output is wrong
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 1308 KB Error : Output is wrong
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 1316 KB Error : Output is wrong
2 Halted 0 ms 0 KB -