Submission #1031638

#TimeUsernameProblemLanguageResultExecution timeMemory
1031638vjudge1Sequence (APIO23_sequence)C++17
28 / 100
2093 ms54472 KiB
#include "sequence.h" #include <bits/stdc++.h> #include<bits/extc++.h> using namespace std; using namespace __gnu_pbds; tree<int,null_type,less_equal<int>,rb_tree_tag,tree_order_statistics_node_update>stt; map<int,int>mp; int sequence(int N, std::vector<int> A) { int ans=0; for(int i=0;i<N;i++){ mp.clear(); stt.clear(); for(int j=i;j<N;j++){ stt.insert(A[j]); mp[A[j]]++; int a=*stt.find_by_order((j-i)/2),b=*stt.find_by_order((j-i+1)/2); ans=max({ans,mp[a],mp[b]}); } } 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...