QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#592274 | #6606. The Boomsday Project | tkt0506 | WA | 332ms | 8792kb | C++14 | 738b | 2024-09-26 21:42:28 | 2024-09-26 21:42:29 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
ll n, m, r;
cin >> n >> m >> r;
vector<ll>d(n), k(n), c(n);
for(ll i=0; i<n; i++)cin >> d[i] >> k[i] >> c[i];
vector<ll>a;
a.push_back(-1e10);
for(ll i=0; i<m; i++){
ll p, q;
cin >> p >> q;
while(q--)a.push_back(p);
}
ll cnt = a.size();
vector<ll>dp(cnt,1e18);
dp[0] = 0;
vector<ll>last(n,0);
for(ll i=1; i<cnt; i++){
dp[i] = dp[i-1]+r;
for(ll j=0; j<n; j++){
while(i-last[j] > k[j] || a[i]-a[last[j]+1] >= d[j])last[j]++;
dp[i] = min(dp[i], dp[last[j]]+c[j]);
}
}
cout << dp.back();
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3568kb
input:
2 1 10 1 3 12 1 2 9 1 10
output:
42
result:
ok 1 number(s): "42"
Test #2:
score: 0
Accepted
time: 0ms
memory: 3560kb
input:
2 4 10 1 3 12 1 2 9 1 3 2 3 3 3 4 1
output:
45
result:
ok 1 number(s): "45"
Test #3:
score: -100
Wrong Answer
time: 332ms
memory: 8792kb
input:
500 100 1000 95 20 20892 73 627 55354 52 747 1404314 19 676 597007 65 814 1569851 91 397 691575 81 4 4575 97 382 624404 21 197 201850 67 799 643576 27 895 1510533 3 800 552439 49 954 1149851 70 892 676406 82 882 1348956 1 318 324094 43 238 439111 94 397 471003 16 119 130686 1 637 77731 79 292 35234 ...
output:
451888
result:
wrong answer 1st numbers differ - expected: '450790', found: '451888'