# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
982220 | vjudge1 | Sequence (APIO23_sequence) | C++17 | 2065 ms | 54612 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "sequence.h"
#include<bits/extc++.h>
#include<bits/stdc++.h>
using namespace std;
using namespace __gnu_pbds;
tree<int,null_type,less_equal<>,rb_tree_tag,tree_order_statistics_node_update> st;
multiset<int>st2;
int sequence(int N, std::vector<int> A) {
int ans=0;
for(int i=0;i<N;i++){
st.clear();
st2.clear();
for(int j=i;j<N;j++) {
st.insert(A[j]);
st2.insert(A[j]);
int A=*st.find_by_order(j-i>>1);
int B=*st.find_by_order(j-i+1>>1);
ans=max(ans,(int)st2.count(A));
ans=max(ans,(int)st2.count(B));
}
}
return ans;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |