Submission #1057424

# Submission time Handle Problem Language Result Execution time Memory
1057424 2024-08-13T19:11:44 Z juicy 라멘 (JOI14_ramen) C++17
0 / 100
0 ms 348 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 (Compare(mi, a) == 1) {
      mi = a;
    }
    if (Compare(b, ma) == 1) {
      ma = b;
    }
  }
  Answer(mi, ma);
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Runtime error 0 ms 348 KB Execution failed because the return code was nonzero
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Runtime error 0 ms 348 KB Execution failed because the return code was nonzero
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 0 ms 348 KB Execution failed because the return code was nonzero
2 Halted 0 ms 0 KB -