Submission #654158

#TimeUsernameProblemLanguageResultExecution timeMemory
654158FarbodFinancial Report (JOI21_financial)C++17
12 / 100
808 ms5348 KiB
#include <iostream> #include <vector> using namespace std; const int N = 3e5 + 1; int n, d, a[N], ans = 1; vector <int> v; signed main() { cin >> n >> d; for (int i = 0; i < n; i++) cin >> a[i]; for (int i = n - 1; i >= 0; i--) { while (v.size() && a[v.back()] <= a[i]) v.pop_back(); v.push_back(i); cerr << v.size() << '\n'; ans = max(ans, (int)v.size()); } cout << ans; 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...