제출 #1134109

#제출 시각아이디문제언어결과실행 시간메모리
1134109ByeWorldFinancial Report (JOI21_financial)C++20
12 / 100
79 ms6840 KiB
#include <bits/stdc++.h>
#define int long long
#define ll long long
#define pb push_back
#define fi first
#define se second
#define lf (id<<1)
#define rg ((id<<1)|1)
#define md ((l+r)>>1)
#define ld long double
using namespace std;
typedef pair<int,int> pii;
typedef pair<char,char> pcc;
typedef pair<int,pii> ipii;
typedef pair<pii,pii> ipiii;
const int MAXN = 3e5+10;
const int SQRT = 610;
const int MAXA = 50;
const int MOD = 1e6+7;
const int INF = 1e18+10;
const int LOG = 30;
void chmx(pii &a, pii b){
    if(a.fi < b.fi) a = b;
    else if(a.fi == b.fi && a.se > b.se) a = b;
}

int n, d, a[MAXN];
pii dp[MAXN];

signed main(){
    // ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    cin>>n>>d;
    for(int i=1; i<=n; i++) cin>>a[i];
    int mx = 1;
    vector <int> vec;
    for(int i=n; i>=1; i--){
        while(!vec.empty() && vec.back()<=a[i]) vec.pop_back();
        vec.pb(a[i]);
        mx = max(mx, (int)vec.size());
    }
    cout << mx << '\n';
}
#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...