Submission #42344

# Submission time Handle Problem Language Result Execution time Memory
42344 2018-02-26T08:58:21 Z minhtung0404 라멘 (JOI14_ramen) C++14
100 / 100
2 ms 756 KB
#include "ramen.h"
#include <bits/stdc++.h>
using namespace std;

typedef pair <int, int> ii;

ii solve(int l, int r){
    if (l == r) return ii(l, l);
    if (l + 1 == r){
        if (Compare(l, r) == 1) return ii(r, l);
        else return ii(l, r);
    }
    ii a = solve(l + 2, r), ans;
    if (Compare(l, l+1) == 1) {
        ans.first = l+1; ans.second = l;
    }
    else{
        ans.first = l; ans.second = l+1;
    }
    if (Compare(ans.first, a.first) == 1) ans.first = a.first;
    if (Compare(a.second, ans.second) == 1) ans.second = a.second;
    return ans;
}

void Ramen(int N) {
    ii a = solve(0, N-1);
	Answer(a.first, a.second);
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 248 KB Output is correct
2 Correct 1 ms 356 KB Output is correct
3 Correct 1 ms 468 KB Output is correct
4 Correct 1 ms 572 KB Output is correct
5 Correct 1 ms 572 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 596 KB Output is correct
2 Correct 1 ms 660 KB Output is correct
3 Correct 1 ms 660 KB Output is correct
4 Correct 1 ms 700 KB Output is correct
5 Correct 1 ms 736 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 736 KB Output is correct
2 Correct 2 ms 744 KB Output is correct
3 Correct 1 ms 748 KB Output is correct
4 Correct 1 ms 752 KB Output is correct
5 Correct 1 ms 756 KB Output is correct