Submission #985401

#TimeUsernameProblemLanguageResultExecution timeMemory
985401ag_1204Sequence (APIO23_sequence)C++17
11 / 100
2054 ms8688 KiB
#include<bits/stdc++.h> using namespace std; #define long long int int sequence(int N, std::vector<int> A) { int ans=0; for (int i=0;i<N;i++) { vector<int> v; multiset<int> s; for (int j=i;j<N;j++) { v.push_back(A[j]); s.insert(A[j]); sort(v.begin(),v.end()); int m=size(v); int k = m/2; if (m%2==0) { int s1=v[k], s2=v[k-1]; int t=max(s.count(s1),s.count(s2)); ans = max(t,ans); } else { int s1=v[k]; int r=s.count(s1); ans = max(r,ans); } } } 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...