Submission #954253

#TimeUsernameProblemLanguageResultExecution timeMemory
954253Trisanu_DasSequence (APIO23_sequence)C++17
11 / 100
2093 ms7508 KiB
#include <bits/stdc++.h> #include "sequence.h" using namespace std; int sequence(int n, vector<int> a){ int ans = 0; for(int i = 0; i < n; i++){ int s = 0, c = 0; for(int j = i; j > -1; j--){ if(a[i] == a[j]) c++; if(a[i] > a[j]) s--; if(a[i] < a[j]) s++; if(abs(s) <= c) ans = max(ans, c); } } 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...