【CodeForces】[604A]Uncowed Forces
2016-07-21 15:24
302 查看
注意数据类型
防止精度丢失
#include<stdio.h> double max(double a,double b) { return a>b?a:b; } int main() { int m[5]; while(scanf("%d",&m[0])!=EOF) { int s[]= {500,1000,1500,2000,2500}; for(int i=1; i<5; i++) scanf("%d",&m[i]); int w[5]; for(int i=0; i<5; i++) scanf("%d",&w[i]); int h1,h2; scanf("%d %d",&h1,&h2); double sum=0; for(int i=0; i<5; i++) { sum+=max(0.3*s[i],(1-m[i]/250.0)*s[i]-50*w[i]); } printf("%.lf\n",sum+100*h1-50*h2); } return 0; }
题目地址:【CodeForces】[604A]Uncowed Forces
相关文章推荐
- Codeforces Round #197 (Div. 2)
- Codeforces Round #198 (Div. 1)
- Codeforces 405E Codeforces Round #238 (Div. 2)E
- Codeforces 407C Codeforces Round #239 (Div. 1)C
- CodeForces 449A - Jzzhu and Chocolate
- CodeForces 449 B. Jzzhu and Cities
- codeforces 618C. Constellation
- Codeforces Round #349 (Div. 2) - C
- Codeforces Round #361 (Div. 2)
- 7.13Codeforces Round #360 (Div. 2)
- Codeforces Round #363 (Div. 2)
- Codeforces Round #265 (Div. 2)
- Codeforces #310 div2 C. Case of Matryoshkas
- 状态压缩DP codeforces 244 Problem C. The Brand New Function 和 codeforces 165 E. Compatible Numbers
- codeforces 16 Problem E fish
- Codeforces Round332 部分题解
- CodeForces 603A_Alternative Thinking (DP)
- CodeForces 602B_Approximating a Constant Range_DP
- Codeforces round #247 for Div. 2
- Codeforces Round #246 (Div. 2)