답안 #1057425

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1057425 2024-08-13T19:14:26 Z juicy 라멘 (JOI14_ramen) C++17
100 / 100
1 ms 436 KB
#include "ramen.h"

#include <bits/stdc++.h>

void Ramen(int N) {
  int mi = 0, ma = 0;
  if (N & 1) {
    mi = ma = N - 1;
  }
  for (int i = 0; i + 1 < N; i += 2) {
    int a = i, b = i + 1;
    if (Compare(a, b) == 1) {
      std::swap(a, b);
    }
    if (mi != a && Compare(mi, a) == 1) {
      mi = a;
    }
    if (b != ma && Compare(b, ma) == 1) {
      ma = b;
    }
  }
  Answer(mi, ma);
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 436 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct