This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
/**
* بسم الله الرحمن الرحيم *
﴾ رَبِّ اشْرَحْ لِي صَدْرِي * وَيَسِّرْ لِي أَمْرِي * وَاحْلُلْ عُقْدَةً مِّن لِّسَانِي * يَفْقَهُوا قَوْلِي ﴿
*/
/// author : "ASGA_RedSea"
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
/// #define endl '\n'
using ll = long long;
using ld = long double;
using ull = unsigned long long;
const ll mod = 1000000007;
const ll mod1 = 998244353;
vector <int> dx = {0,0,-1,1},dy = {-1,1,0,0};
vector <char> dir = {'L','R','U','D'};
#include <sequence.h>
int sequence(int n,vector <int> a){
int ans = 0;
vector <int> b;
map <int,int> f;
for(int l = 0;l < n;l++){
for(int r = l;r < n;r++){
b = vector <int> (a.begin() + l,a.begin() + r + 1);
sort(b.begin(),b.end());int sz = r - l;
for(auto& i : b)f[i]++;
ans = max(ans,max(f[b[sz / 2]],f[b[(sz / 2) + (sz & 1)]]));
f.clear();
}
}
return ans;
}
/*
signed main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
/// cout << fixed << setprecision(0);
/// cout.tie(0);
/// freopen("test.in", "r", stdin);
/// freopen("test.out", "w", stdout);
/// #undef endl
;
return 0;
}
*/
# | 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... |