답안 #18870

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
18870 2016-02-16T06:06:27 Z choyi0521 라멘 (JOI14_ramen) C++
100 / 100
0 ms 1124 KB
#include "ramen.h"
void Ramen(int N) {
	int l, r;
	l = r = N%2?N - 1:-1;
	for (int i = 1; i < N; i += 2) {
		int x=i-1, y=i;
		if (Compare(x, y) == 1) x ^= y ^= x ^= y;
		if (l==-1||Compare(l,x) == 1) l = x;
		if (r==-1||Compare(y,r) == 1) r = y;
	}
	Answer(l, r);
}

Compilation message


# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 1124 KB Output is correct
2 Correct 0 ms 1124 KB Output is correct
3 Correct 0 ms 1124 KB Output is correct
4 Correct 0 ms 1124 KB Output is correct
5 Correct 0 ms 1124 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 1124 KB Output is correct
2 Correct 0 ms 1124 KB Output is correct
3 Correct 0 ms 1124 KB Output is correct
4 Correct 0 ms 1124 KB Output is correct
5 Correct 0 ms 1124 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 1124 KB Output is correct
2 Correct 0 ms 1124 KB Output is correct
3 Correct 0 ms 1124 KB Output is correct
4 Correct 0 ms 1124 KB Output is correct
5 Correct 0 ms 1124 KB Output is correct