Submission #1085186

#TimeUsernameProblemLanguageResultExecution timeMemory
1085186TimoshSequence (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...