Submission #978913

#TimeUsernameProblemLanguageResultExecution timeMemory
978913rakhim_ovaSequence (APIO23_sequence)C++17
28 / 100
2051 ms54492 KiB
#include <bits/stdc++.h> using namespace std; #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; template<class T> using indexed_set=tree<T, null_type, less_equal<T>, rb_tree_tag,tree_order_statistics_node_update> ; int sequence(int n, std::vector<int> a) { int res=0; for(int i=0; i<n; i++){ indexed_set<int> ist; map<int, int> mp; for(int j=i; j<n; j++){ ist.insert(a[j]); mp[a[j]]++; res=max(res, mp[*ist.find_by_order((j-i+1)/2)]); if((j-i+1)%2==0){ res=max(res, mp[*ist.find_by_order((j-i+1)/2-1)]); } } } return res; }
#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...