#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
//#include<bits/extc++.h>
//__gnu_pbds
#define int ll
ll dp[3005];
vector<int> stop;
signed main(){
ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
int n,m,k;cin>>n>>m>>k;
int a,B,c;cin>>a>>B>>c;
ll T;cin>>T;
stop.resize(m);
k-=m;
for(int i=0;i<k;i++) dp[i]=0;
for(int i=0;i<m;i++){cin>>stop[i];stop[i]--;}
for(int i=1;i<m;i++){
if(stop[i-1]*B>=T) break;
for(int b=k;b>=0;b--){
int tt = stop[i-1]*B;
int ss = stop[i-1]+((T-tt)/a)+1;
for(int j=0;j<=b;j++){
dp[b]= max(dp[b-j]+min(ss-stop[i-1],stop[i]-stop[i-1]),dp[b]);
tt = ss*c;
ss = ss+((T-tt)/a)+1;
if(tt>=T) break;
}
}
}
cout<<dp[k]<<"\n";
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |