且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Hdu 5268 (BestCoder Round #44 A)

更新时间:2022-08-13 08:48:54

http://acm.hdu.edu.cn/showproblem.php?pid=5268
简单水题:
只给出代码:

#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
    int T,a,b;
    cin>>T;
    for(int k=1; k<=T; k++)
    {
        int sum,ans=0;
        for(int i=2; i<=5; i++)
        {
            cin>>a>>b;
            sum=2*i*(250-a)-50*b;
            ans+=max(sum,(int)(0.4*i*500));
        }
        cout<<"Case #"<<k<<": "<<ans<<endl;
    }
    return 0;
}