Submission #154053

# Submission time Handle Problem Language Result Execution time Memory
154053 2019-09-18T03:51:59 Z combi1k1 라멘 (JOI14_ramen) C++14
50 / 100
3 ms 504 KB
#include "ramen.h"
#include<bits/stdc++.h>

int L = 0;
int R = 0;

void calc(int l,int r)  {
    if (r - l == 0) {
        L = R = l;
        return;
    }
    if (r - l == 1) {
        L = l;
        R = r;
        if (Compare(L,R) < 0)
            L = r,
            R = l;
        return;
    }
    int m = (l + r) / 2;
    calc(l,m);  ++m;
    int ll = L;
    int rr = R;
    calc(m,r);
    if (Compare(L,ll) < 0)  L = ll;
    if (Compare(R,rr) > 0)  R = rr;

}
void Ramen(int n)   {
    calc(0,n - 1);
    Answer(R,L);
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 504 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 256 KB Output is correct
5 Correct 3 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 2 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 256 KB Output is correct
2 Runtime error 2 ms 256 KB Execution failed because the return code was nonzero
3 Halted 0 ms 0 KB -