結果
| 問題 | No.3424 Shooting Game |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-01-11 16:03:25 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 1,113 bytes |
| 記録 | |
| コンパイル時間 | 3,285 ms |
| コンパイル使用メモリ | 350,180 KB |
| 実行使用メモリ | 11,488 KB |
| 最終ジャッジ日時 | 2026-01-11 17:24:01 |
| 合計ジャッジ時間 | 5,335 ms |
|
ジャッジサーバーID (参考情報) |
judge6 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 10 WA * 1 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main(void){
int n,t;
cin>>n>>t;
vector<pair<pair<int,int>,int>>v;
for(int i=0;i<n;i++){
int l,r,p;
cin>>l>>r>>p;
v.push_back({{l,r},p});
}
sort(v.begin(), v.end());
int maxv[200001]={};
priority_queue<pair<int,int>>pq;
int it=0;
for(int i=0;i<200001;i++){
while(1){
if(it>=n)break;
if(v[it].first.first==i){
pq.push({v[it].second,v[it].first.second});
it++;
}else{
break;
}
}
while(1){
if(pq.empty())break;
if(pq.top().second<=i-1){
pq.pop();
}else{
break;
}
}
if(pq.empty())continue;
maxv[i]=pq.top().first;
}
long long ans=0;
long long dp[200001]={};
for(int i=0;i<200001;i++){
if(i+t>200000){
if(ans<dp[i]+maxv[i])ans=dp[i]+maxv[i];
}else{
dp[i+t]=maxv[i]+dp[i];
}
}
cout<<ans<<endl;
return 0;
}