結果
| 問題 | No.3116 More and more teleporter |
| コンテスト | |
| ユーザー |
みどりむし🦠
|
| 提出日時 | 2025-04-20 03:34:18 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 750 bytes |
| 記録 | |
| コンパイル時間 | 2,936 ms |
| コンパイル使用メモリ | 279,496 KB |
| 実行使用メモリ | 10,556 KB |
| 最終ジャッジ日時 | 2025-04-20 03:34:26 |
| 合計ジャッジ時間 | 6,431 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 6 WA * 16 |
ソースコード
#include <bits/stdc++.h>
#include <atcoder/lazysegtree>
long e() { return 0; }
long op(long a, long b) { return a + b; }
long id() { return 0; }
long mapping(long f, long x) { return f + x; }
long conbine(long f, long g) { return f + g; }
using Segtree = atcoder::lazy_segtree<long, op, e, long, mapping, conbine, id>;
int main() {
int n; std::cin >> n;
Segtree data(n);
for(int i : std::views::iota(0, n)) {
data.set(i, i);
}
int q; std::cin >> q;
for(int _ : std::views::iota(0, q)) {
int t; std::cin >> t; --t;
if(t == 0) {
int x; std::cin >> x; --x;
std::cout << data.get(x) << "\n";
}
if(t == 1) {
int x; long c; std::cin >> x >> c; --x;
if(data.get(x) > c) {
data.apply(x, n, c - data.get(x));
}
}
}
}
みどりむし🦠