結果
| 問題 | No.3424 Shooting Game |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-01-15 17:48:28 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,004 bytes |
| 記録 | |
| コンパイル時間 | 2,538 ms |
| コンパイル使用メモリ | 227,468 KB |
| 実行使用メモリ | 24,284 KB |
| 最終ジャッジ日時 | 2026-01-15 17:48:33 |
| 合計ジャッジ時間 | 5,050 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge6 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 10 WA * 1 |
ソースコード
#include <bits/stdc++.h>
#include <atcoder/lazysegtree>
using namespace std;
using S = long long;
using F = long long;
const S INF = 8e18;
const F ID = 8e18;
S op(S a, S b){ return std::max(a, b); }
S e(){ return 0; }
S mapping(F f, S x){ return (f == ID ? x : f); }
F composition(F f, F g){ return (f == ID ? g : f); }
F id(){ return ID; }
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int N, T; cin >> N >> T;
vector<array<long long, 3>> PLR(N);
for (auto& row : PLR) {
cin >> row[1] >> row[2] >> row[0];
}
sort(PLR.begin(), PLR.end());
const int SIZE = 4 << 17;
atcoder::lazy_segtree<S, op, e, F, mapping, composition, id> seg(SIZE);
for (auto [p, l, r] : PLR) {
seg.apply(l, r + 1, p);
}
vector<long long> dp(SIZE + 1, 0);
long long ans = 0LL;
for (int i = 0; i < SIZE - T + 1; i++) {
dp[i + T] = max(dp[i + T], dp[i] + seg.get(i));
ans = max(ans, dp[i + T]);
}
cout << ans << endl;
}