Submission #10688

# Submission time Handle Problem Language Result Execution time Memory
10688 2014-11-03T14:07:18 Z dohyun0324 라멘 (JOI14_ramen) C++
100 / 100
0 ms 1128 KB
#include "ramen.h"
int a[410],b[410],w1,w2;
void Ramen(int N) {
    int i,s,p,q;
    if(N==1) Answer(0,0);
    for(i=0;i<N-1;i+=2)
    {
        s=Compare(i,i+1);
        if(s==1) a[++w1]=i, b[++w2]=i+1;
        else a[++w1]=i+1, b[++w2]=i;
    }
    if(N%2==1) a[++w1]=N-1, b[++w2]=N-1;
    p=a[1];
    for(i=2;i<=w1;i++)
    {
        s=Compare(p,a[i]);
        if(s==-1) p=a[i];
    }
    q=b[1];
    for(i=2;i<=w2;i++)
    {
        s=Compare(q,b[i]);
        if(s==1) q=b[i];
    }
    Answer(q,p);
}

Compilation message


# Verdict Execution time Memory Grader output
1 Correct 0 ms 1128 KB Output is correct
2 Correct 0 ms 1128 KB Output is correct
3 Correct 0 ms 1128 KB Output is correct
4 Correct 0 ms 1128 KB Output is correct
5 Correct 0 ms 1128 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 1128 KB Output is correct
2 Correct 0 ms 1128 KB Output is correct
3 Correct 0 ms 1128 KB Output is correct
4 Correct 0 ms 1128 KB Output is correct
5 Correct 0 ms 1128 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 1128 KB Output is correct
2 Correct 0 ms 1128 KB Output is correct
3 Correct 0 ms 1128 KB Output is correct
4 Correct 0 ms 1128 KB Output is correct
5 Correct 0 ms 1128 KB Output is correct