結果
| 問題 |
No.3198 Monotonic Query
|
| コンテスト | |
| ユーザー |
Andrew8128
|
| 提出日時 | 2025-07-11 21:34:14 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 245 ms / 3,000 ms |
| コード長 | 1,195 bytes |
| コンパイル時間 | 1,184 ms |
| コンパイル使用メモリ | 113,128 KB |
| 実行使用メモリ | 8,600 KB |
| 最終ジャッジ日時 | 2025-07-12 10:51:46 |
| 合計ジャッジ時間 | 7,207 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 |
ソースコード
#include <iostream>
using std::cerr, std::cin, std::cout, std::endl, std::fixed, std::flush;
#include <algorithm>
using std::clamp, std::ranges::count, std::ranges::count_if, std::ranges::fill, std::ranges::find, std::ranges::find_if, std::ranges::is_permutation;
using std::ranges::lower_bound, std::ranges::max, std::ranges::max_element, std::ranges::min, std::ranges::min_element, std::ranges::next_permutation;
using std::ranges::prev_permutation, std::ranges::reverse, std::ranges::rotate, std::ranges::sort, std::ranges::unique, std::ranges::upper_bound;
static_assert(sizeof(long) == 8);
#include <atcoder/segtree>
using namespace atcoder;
int main()
{
auto op = [](int a, int b)
{
return max(a, b);
};
auto e = []()
{
return -1;
};
segtree<long, op, e> st(200000);
int cnt = 0;
int Q;
cin >> Q;
for (int i = 0; i < Q; i++)
{
int op;
cin >> op;
switch (int x, k; op)
{
case 1:
cin >> x;
st.set(cnt, x);
cnt++;
break;
case 2:
cin >> k;
cout << st.prod(cnt - k, cnt) << '\n';
break;
}
}
return 0;
}
/*
File : ~/kyopro/yukicoder/554/3198.cpp
Date : 2025/07/11
Time : 21:30:16
*/
Andrew8128