Submission #1109258

#TimeUsernameProblemLanguageResultExecution timeMemory
1109258SalihSahinFinancial Report (JOI21_financial)C++14
12 / 100
35 ms8008 KiB
#include <bits/stdc++.h> #define pb push_back #define int long long using namespace std; const int mod = 998244353; const int inf = 1e9 + 20; const int N = 1e5+5; int32_t main(){ cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(false); int n, d; cin>>n>>d; vector<int> a(n); for(int i = 0; i < n; i++){ cin>>a[i]; } stack<int> st; int ans = 0; for(int i = n-1; i >= 0; i--){ while(!st.empty() && st.top() <= a[i]) st.pop(); st.push(a[i]); ans = max(ans, (int)st.size()); } cout<<ans<<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...