結果
| 問題 | No.3198 Monotonic Query |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-07-11 21:28:23 |
| 言語 | C++17(gcc12) (gcc 12.4.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 150 ms / 3,000 ms |
| + 8µs | |
| コード長 | 545 bytes |
| 記録 | |
| コンパイル時間 | 3,266 ms |
| コンパイル使用メモリ | 206,484 KB |
| 実行使用メモリ | 8,960 KB |
| 最終ジャッジ日時 | 2026-07-13 04:47:21 |
| 合計ジャッジ時間 | 7,098 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 |
ソースコード
#include <bits/stdc++.h>
#include <atcoder/segtree>
using namespace std;
using namespace atcoder;
long long op(long long a, long long b) {
return max(a, b);
}
long long e() {
return -1e18;
}
int main() {
int q;
cin >> q;
segtree<long long, op, e> seg(q);
int cnt = 0;
for (int i = 0; i < q; ++i) {
int t;
long long x;
cin >> t >> x;
if (t == 1) {
seg.set(cnt++, x);
} else {
cout << seg.prod(cnt - x, cnt) << '\n';
}
}
return 0;
}