답안 #19131

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
19131 2016-02-18T17:08:38 Z eaststar 라멘 (JOI14_ramen) C++14
100 / 100
0 ms 1124 KB
#include "ramen.h"
void Ramen(int n){
    int i,m=0,M=1;
    if(n<2)Answer(0,0);
    if(Compare(0,1)>0)M=0,m=1;
    for(i=2;i+1<n;i+=2){
        if(Compare(i,i+1)>0){
            M=(Compare(i,M)>0?i:M);
            m=(Compare(i+1,m)<0?i+1:m);
        }
        else{
            M=(Compare(i+1,M)>0?i+1:M);
            m=(Compare(i,m)<0?i:m);
        }
    }
    if(n%2){
        M=(Compare(n-1,M)>0?n-1:M);
        m=(Compare(n-1,m)<0?n-1:m);
    }
    Answer(m,M);
}

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