結果
| 問題 |
No.8121 [Deleted]
|
| コンテスト | |
| ユーザー |
a01sa01to
|
| 提出日時 | 2025-09-04 00:06:27 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 568 bytes |
| コンパイル時間 | 3,452 ms |
| コンパイル使用メモリ | 281,168 KB |
| 実行使用メモリ | 7,720 KB |
| 最終ジャッジ日時 | 2025-09-04 00:06:34 |
| 合計ジャッジ時間 | 6,360 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | WA * 10 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
using ll = long long;
using ull = unsigned long long;
#include <atcoder/fenwicktree>
int main() {
cin.tie(nullptr)->sync_with_stdio(false);
int n, q;
cin >> n >> q;
vector<ll> a(n);
rep(i, n) cin >> a[i];
atcoder::fenwick_tree<ll> fw(n);
rep(i, n) fw.add(i, a[i]);
rep(_, q) {
int t, x, y;
cin >> t >> x >> y;
if (t == 1) {
fw.add(x, y - a[x]);
a[x] = y;
}
else {
cout << fw.sum(x, y) << '\n';
}
}
return 0;
}
a01sa01to