제출 #981964

#제출 시각아이디문제언어결과실행 시간메모리
981964alo_54서열 (APIO23_sequence)C++17
0 / 100
2070 ms8780 KiB
#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; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...