# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
948952 | IBory | 라멘 (JOI14_ramen) | C++17 | 1 ms | 348 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "ramen.h"
#include <bits/stdc++.h>
using namespace std;
//const int MAX = 404;
//int T[MAX];
//
//void Answer(int a, int b) {
// cout << a << ' ' << b << '\n';
// return;
//}
//
//int Compare(int a, int b) {
// return (T[a] > T[b] ? 1 : -1);
//}
void Ramen(int N) {
if (N == 1) {
Answer(0, 0);
return;
}
vector<int> L, R;
for (int i = 0; i < N; i += 2) {
if (i + 1 == N) break;
int n = Compare(i, i + 1);
(n > 0 ? R : L).push_back(i);
(n > 0 ? L : R).push_back(i + 1);
}
if (N & 1) L.push_back(N - 1), R.push_back(N - 1);
int a = L[0], b = R[0];
for (int i = 1; i < L.size(); ++i) if (Compare(a, L[i]) > 0) a = L[i];
for (int i = 1; i < R.size(); ++i) if (Compare(R[i], b) > 0) b = R[i];
Answer(b, a);
}
//int main() {
// int N;
// cin >> N;
// for (int i = 0; i < N; ++i) cin >> T[i];
//
// Ramen(N);
// return 0;
//}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |