結果
問題 |
No.3198 Monotonic Query
|
ユーザー |
![]() |
提出日時 | 2025-07-11 21:33:48 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 241 ms / 3,000 ms |
コード長 | 438 bytes |
コンパイル時間 | 1,889 ms |
コンパイル使用メモリ | 198,404 KB |
実行使用メモリ | 7,844 KB |
最終ジャッジ日時 | 2025-07-12 10:51:41 |
合計ジャッジ時間 | 8,021 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 22 |
ソースコード
#include <bits/stdc++.h> #include <atcoder/segtree> using namespace std; using namespace atcoder; int op(int x,int y){return max(x,y);} int e(){return 0;} int main(){ int q;cin>>q; segtree<int,op,e> sg(q); int r=0; while(q--){ int op;cin>>op; if(op==1){ int x;cin>>x; sg.set(r++,x); }else{ int k;cin>>k; cout<<sg.prod(r-k,r)<<"\n"; } } }