結果
| 問題 | No.3198 Monotonic Query |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-07-11 21:27:23 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 33 ms / 3,000 ms |
| + 145µs | |
| コード長 | 551 bytes |
| 記録 | |
| コンパイル時間 | 2,929 ms |
| コンパイル使用メモリ | 274,816 KB |
| 実行使用メモリ | 6,272 KB |
| 最終ジャッジ日時 | 2026-07-13 04:47:05 |
| 合計ジャッジ時間 | 5,042 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 |
ソースコード
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using ll = long long;
int op(int lhs, int rhs){return max(lhs, rhs);}
constexpr int e(){return -(1 << 30);}
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int Q;
cin >> Q;
atcoder::segtree<int, op, e> seg(Q + 1);
int cur = 0;
while(Q--){
int cmd, x;
cin >> cmd >> x;
if(cmd == 1){
seg.set(cur, x);
cur++;
}else{
cout << seg.prod(max(0, cur - x), cur) << '\n';
}
}
}