結果
| 問題 | No.3424 Shooting Game |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-01-16 14:08:05 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 668 bytes |
| 記録 | |
| コンパイル時間 | 2,274 ms |
| コンパイル使用メモリ | 220,332 KB |
| 実行使用メモリ | 17,836 KB |
| 最終ジャッジ日時 | 2026-01-16 14:08:09 |
| 合計ジャッジ時間 | 4,259 ms |
|
ジャッジサーバーID (参考情報) |
judge6 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 2 |
| other | AC * 8 WA * 3 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
constexpr int SIZE = 2 << 17;
long long dp[SIZE];
vector<pair<int, int>> PR[SIZE];
priority_queue<pair<int, int>> pq;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int N, T;
cin >> N >> T;
while (N--) {
int l, r, p;
cin >> l >> r >> p;
PR[l].emplace_back(p, r);
}
pq.push({0, SIZE});
for (int i = 0; i < SIZE; i++) {
for (auto [p, r] : PR[i]) {
pq.push({p, r});
}
while (pq.top().second < i) pq.pop();
dp[i] = max(dp[i - 1], dp[max(0, i - T)] + pq.top().first);
}
cout << dp[SIZE - 1] << endl;
}