답안 #39360

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
39360 2018-01-12T12:22:19 Z 14kg 라멘 (JOI14_ramen) C++11
100 / 100
0 ms 1120 KB
#include "ramen.h"

void Ramen(int n) {
	int d[400][2], k=1;

	for (int i = 0; i < n; i++) d[i][0] = d[i][1] = i;
	while (k < n) {
		for (int i = 0; i + k < n; i += k * 2) {
			d[i][0] = Compare(d[i][0], d[i + k][0]) > 0 ? d[i][0] : d[i + k][0];
			if (k > 1) d[i][1] = Compare(d[i][1], d[i + k][1]) < 0 ? d[i][1] : d[i + k][1];
			else d[i][1] = (i * 2 + k) - d[i][0];
		} k *= 2;
	} Answer(d[0][1], d[0][0]);
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 1120 KB Output is correct
2 Correct 0 ms 1120 KB Output is correct
3 Correct 0 ms 1120 KB Output is correct
4 Correct 0 ms 1120 KB Output is correct
5 Correct 0 ms 1120 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 1120 KB Output is correct
2 Correct 0 ms 1120 KB Output is correct
3 Correct 0 ms 1120 KB Output is correct
4 Correct 0 ms 1120 KB Output is correct
5 Correct 0 ms 1120 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 1120 KB Output is correct
2 Correct 0 ms 1120 KB Output is correct
3 Correct 0 ms 1120 KB Output is correct
4 Correct 0 ms 1120 KB Output is correct
5 Correct 0 ms 1120 KB Output is correct