結果
| 問題 |
No.1234 典型RMQ
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-06-30 03:45:23 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 79 ms / 2,000 ms |
| コード長 | 669 bytes |
| コンパイル時間 | 2,897 ms |
| コンパイル使用メモリ | 281,636 KB |
| 実行使用メモリ | 7,844 KB |
| 最終ジャッジ日時 | 2025-06-30 03:45:31 |
| 合計ジャッジ時間 | 7,620 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 27 |
ソースコード
#include <bits/stdc++.h>
#include <atcoder/lazysegtree>
using namespace atcoder;
using namespace std;
using ll = long long;
using T = ll;
using F = ll;
T op(T l, T r) { return min(l, r); }
T e() { return 1e18; }
T fx(F f, T x) { return f + x; }
F fg(F f, F g) { return f + g; }
F id() { return 0; }
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
ll N;
cin >> N;
vector<ll> A(N);
for(auto &i : A) { cin >> i; }
lazy_segtree<T, op, e, F, fx, fg, id> S(A);
ll Q;
cin >> Q;
while(Q--) {
ll type, l, r, c;
cin >> type >> l >> r >> c;
if(type == 1) { S.apply(--l, r, c); }
else { cout << S.prod(--l, r) << "\n"; }
}
}