結果
問題 |
No.3198 Monotonic Query
|
ユーザー |
|
提出日時 | 2025-07-12 02:25:25 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 249 ms / 3,000 ms |
コード長 | 484 bytes |
コンパイル時間 | 1,010 ms |
コンパイル使用メモリ | 112,080 KB |
実行使用メモリ | 7,844 KB |
最終ジャッジ日時 | 2025-07-12 10:56:31 |
合計ジャッジ時間 | 7,148 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 22 |
ソースコード
#include <iostream> #include <algorithm> #include <atcoder/segtree> int op(int x, int y) { return std::max(x, y); } int e() { return 0; } int main() { int Q; std::cin >> Q; atcoder::segtree<int, op, e> segtree(Q); int index = 0; while (Q--) { int t, x; std::cin >> t >> x; if (t == 1) { segtree.set(index++, x); } else { std::cout << segtree.prod(index - x, index) << std::endl; } } }