結果

問題 No.8121 [Deleted]
ユーザー hiro1729
提出日時 2025-04-01 21:52:11
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 661 bytes
コンパイル時間 8,573 ms
コンパイル使用メモリ 462,124 KB
実行使用メモリ 26,048 KB
最終ジャッジ日時 2025-04-01 21:52:28
合計ジャッジ時間 16,270 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other WA * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/segtree>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
using namespace atcoder;
using ll = boost::multiprecision::cpp_int;

ll op(ll a, ll b) {
	return max(a, b);
}

ll e() {
	return 0;
}

int main() {
	int N, Q;
	cin >> N >> Q;
	vector<ll> A(N);
	for (int i = 0; i < N; i++) {
	    string A_; cin >> A_;
		A[i] = ll(A_);
	}
	segtree<ll, op, e> seg(A);
	while (Q--) {
		int t;
		cin >> t;
		if (t == 1) {
		    int p;
		    string x;
		    cin >> p >> x;
			p--;
			seg.set(p, seg.get(p) + ll(x));
		} else {
		    int l, r;
		    cin >> l >> r;
			cout << seg.prod(l - 1, r).str() << '\n';
		}
	}
}
0