제출 #960611

#제출 시각아이디문제언어결과실행 시간메모리
960611ASGA_RedSea서열 (APIO23_sequence)C++17
11 / 100
2064 ms8288 KiB
/** * بسم الله الرحمن الرحيم * ﴾ رَبِّ اشْرَحْ لِي صَدْرِي * وَيَسِّرْ لِي أَمْرِي * وَاحْلُلْ عُقْدَةً مِّن لِّسَانِي * يَفْقَهُوا قَوْلِي ﴿ */ /// 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 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...