답안 #154056

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
154056 2019-09-18T04:01:12 Z combi1k1 라멘 (JOI14_ramen) C++14
100 / 100
2 ms 376 KB
#include "ramen.h"

void Ramen(int n)   {
    int L = -1;
    int R = -1;
    for(int i = 0 ; i < n ; i += 2) {
        int x = i;
        int y = i + 1;
        if (y >= n) y = x;
        else    {
            if (Compare(x,y) < 0)
                x = i + 1,
                y = i;
        }
        if (L < 0)  {
            L = x;
            R = y;
        }
        else    {
            if (Compare(L,x) < 0)   L = x;
            if (Compare(R,y) > 0)   R = y;
        }
    }
    Answer(R,L);
}
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 256 KB Output is correct
4 Correct 2 ms 256 KB Output is correct
5 Correct 2 ms 256 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 256 KB Output is correct
4 Correct 2 ms 256 KB Output is correct
5 Correct 2 ms 256 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 256 KB Output is correct
3 Correct 2 ms 256 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 2 ms 376 KB Output is correct