제출 #1085186

#제출 시각아이디문제언어결과실행 시간메모리
1085186Timosh서열 (APIO23_sequence)C++17
11 / 100
2100 ms8712 KiB
#include <bits/stdc++.h> #include "sequence.h" using namespace std; int sequence(int n, vector<int> A) { int ans = 1; for (int i = 0; i < n; i++) { vector<int> cur; map<int, int> mp; for (int j = i; j < n; j++) { cur.push_back(A[j]); mp[A[j]]++; sort(cur.begin(), cur.end()); ans = max(ans, mp[cur[(j - i) / 2]]); ans = max(ans, mp[cur[(j - i + 1) / 2]]); } } return ans; }
#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...