답안 #981964

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
981964 2024-05-13T17:22:21 Z alo_54 서열 (APIO23_sequence) C++17
0 / 100
2000 ms 8780 KB
#include "sequence.h"

#include <bits/stdc++.h>
using namespace std;

int techo(int k)
{
  if (k % 2 == 0)
  {
    return k /2;
  }

  return (k/2) + 1;
  
}

int sequence(int N, std::vector<int> A) 
{

  int maxV = -1;

  for (int i = 0; i < N-1; i++)
  {
    vector <int> arr;

    for (int j = i; j < N; j++)
    {
      arr.push_back(A[i]);
    }

    sort(arr.begin(), arr.end());

    while (!arr.empty())
    {
      int p = arr[arr.size()/2];
      int t = arr[techo(arr.size())];

      maxV = max(maxV, max(p,t));

      arr.pop_back();
    }
    
  }

  return maxV;
  
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Execution timed out 2070 ms 8780 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 2045 ms 8568 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -