제출 #738890

#제출 시각아이디문제언어결과실행 시간메모리
738890veehjFinancial Report (JOI21_financial)C++17
12 / 100
185 ms7844 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; #define F first #define S second #define pb push_back #define sz(a) (int)a.size() #define pll pair<ll, ll> #define all(x) (x).begin(), (x).end() int main() { ll n, d, ans=0; cin >> n >> d; ll a[n]; for(auto& u : a) cin >> u; stack<ll> st; for(ll i=0; i<n; i++){ ll x=a[n-i-1]; while(!st.empty()){ if(st.top()>x) break; st.pop(); } st.push(x); ans=max(ans, (ll)st.size()); } cout << ans << endl; }
#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...