CF964B 题解
Federico2903 · · 题解
思路
我们有
我们再来思考拖时间读的情况。
如果不读,每分钟收益减少
那每封信每分钟的价格变化应该是加上
我们总共到
否则应该收到就读,输出
AC 代码
#include<bits/stdc++.h>
using namespace std;
int n,a,b,c,t,sum;
int m[1005];
int main(){
cin >> n >> a >> b >> c >> t;
for(int i=0;i<n;i++)cin >> m[i],sum+=t-m[i];
int ans=n*a;
if(b<c){
ans+=sum*(c-b);
}
cout << ans;
}