답안 #199149

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
199149 2020-01-29T15:56:05 Z godwind 앵무새 (IOI11_parrots) C++14
52 / 100
11 ms 1520 KB
#include "encoder.h"
#include "encoderlib.h"
 
 
using namespace std;
 
 
void encode(int n, int M[]) {
	for (int i = 0; i < n; ++i) {
		int x = i * 16;
		send(i * 16 + 4 * 0 + M[i] % 4);
		send(i * 16 + 4 * 1 + (M[i] >> 2) % 4);
		send(i * 16 + 4 * 2 + (M[i] >> 4) % 4);
		send(i * 16 + 4 * 3 + (M[i] >> 6) % 4);
	}
}
#include "decoder.h"
#include "decoderlib.h"
 
 
using namespace std;
 
int ans[1000];
 
void decode(int n, int L, int X[]) {
    for (int i = 0; i < n; ++i) {
		ans[i] = 0;
    }
	for (int i = 0; i < L; ++i) {
		int id = X[i] >> 4;
		int r = (X[i] >> 2) % 4;
		ans[id] += (1 << (2 * r)) * (X[i] % 4);
	}
	for (int i = 0; i < n; ++i) {
		output(ans[i]);
    }
}

Compilation message

encoder.cpp: In function 'void encode(int, int*)':
encoder.cpp:10:7: warning: unused variable 'x' [-Wunused-variable]
   int x = i * 16;
       ^
# 결과 실행 시간 메모리 Grader output
1 Correct 10 ms 908 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 10 ms 1520 KB Output is correct
2 Correct 10 ms 1520 KB Output is correct
3 Correct 10 ms 1520 KB Output is correct
4 Correct 11 ms 1520 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 10 ms 1520 KB Output is correct
2 Correct 11 ms 1520 KB Output is correct
3 Correct 11 ms 1520 KB Output is correct
4 Correct 11 ms 1520 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 10 ms 1520 KB Output is correct
2 Correct 11 ms 1520 KB Output is correct
3 Incorrect 10 ms 1016 KB Error : Bad encoded integer
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 11 ms 1520 KB Output is correct - P = 4.000000
2 Incorrect 10 ms 636 KB Error : Bad encoded integer
3 Incorrect 10 ms 888 KB Error : Bad encoded integer
4 Incorrect 10 ms 644 KB Error : Bad encoded integer
5 Incorrect 10 ms 652 KB Error : Bad encoded integer
6 Incorrect 10 ms 992 KB Error : Bad encoded integer
7 Incorrect 9 ms 644 KB Error : Bad encoded integer