結果

問題 No.3198 Monotonic Query
ユーザー Ywestbuilderk
提出日時 2025-07-13 19:43:46
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 385 bytes
コンパイル時間 3,609 ms
コンパイル使用メモリ 253,408 KB
実行使用メモリ 8,400 KB
最終ジャッジ日時 2025-07-13 19:44:00
合計ジャッジ時間 10,184 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#include<atcoder/all>
using namespace std;
using namespace atcoder;
int op(int a,int b){
	return max(a,b);
}
int e(){
	return -1;
}
int main(){
	segtree<int,op,e> seg(3e5);
	int q;
	cin >> q;
	int i = 0;
	while(q--){
		int t,x;
		cin >> t >> x;
		if(t == 1){
			i++;
			seg.set(i,x);
		}
		else{
			cout << seg.prod(i-x+1,i + 1) << endl;
		}
	}
	cout << endl;
}
0