結果
問題 |
No.2433 Min Increasing Sequence
|
ユーザー |
|
提出日時 | 2023-08-21 23:23:24 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 102 ms / 2,000 ms |
コード長 | 626 bytes |
コンパイル時間 | 3,559 ms |
コンパイル使用メモリ | 254,864 KB |
最終ジャッジ日時 | 2025-02-16 12:09:49 |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 32 |
ソースコード
#include <bits/stdc++.h> #include <atcoder/all> using namespace std; using ll = long long; #define rep(i,n) for(int i=0;i<(int)(n);i++) using mint = atcoder::modint998244353; pair<int,int> op(pair<int,int> p,pair<int,int> q){ return min(p,q); } pair<int,int> e(){ return {1e9+10,-1}; } using segtree=atcoder::segtree<pair<int,int>,op,e>; int main(){ int n; cin>>n; vector<int> a(n); rep(i,n) cin>>a.at(i); segtree seg(n); rep(i,n) seg.set(i,{a.at(i),i}); auto[mn,l]=seg.all_prod(); mint ans=1; while(l+1<n){ auto[mn,lr]=seg.prod(l+1,n); if(mn>1e9) break; ans*=(lr-l+1); l=lr; } cout<<ans.val()<<endl; }