Submission #864298

#TimeUsernameProblemLanguageResultExecution timeMemory
864298vjudge1Financial Report (JOI21_financial)C++17
12 / 100
30 ms8208 KiB
#include <bits/stdc++.h> using namespace std; #define endl '\n' #define ll long long #define all(x) x.begin(), x.end() int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n, d; cin >> n >> d; vector<ll> v(n); for (int i = 0; i < n; i++) cin >> v[i]; deque<ll> dq; int ans = 0; dq.push_back(v[n - 1]); for (int i = n - 2; i >= 0; i--) { while (dq.size() && v[i] >= dq.front()) dq.pop_front(); dq.push_front(v[i]); ans = max(ans, (int) dq.size()); } cout << 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...