Submission #1124472

#TimeUsernameProblemLanguageResultExecution timeMemory
1124472dostsSequence (APIO23_sequence)C++17
11 / 100
2095 ms4164 KiB
#include "sequence.h" //Dost SEFEROĞLU #include <bits/stdc++.h> using namespace std; #define int long long #define pii pair<int,int> #define ff first #define ss second #define sp << " " << #define all(cont) cont.begin(),cont.end() #define vi vector<int> int32_t sequence(int32_t N, std::vector<int32_t> A) { int ans = 0; for (int i=0;i<N;i++) { for (int j = i;j<N;j++) { for (int k = i;k<=j;k++) { int b = 0,s = 0,o = 0; for (int kk = i;kk<=j;kk++) { if (A[kk] < A[k]) s++; else if (A[kk] > A[k]) b++; else o++; } if (abs(b-s) <= o) ans = max(ans,o); } } } 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...