题意是说,给定一个计算规则,求最终分数。
又傻逼了QAQ
遇到double类型一定要小心小心小心!
虽然我觉得0.3*x一定是整数..这样子应该没问题的吧。。但还是跪了。下次有double型的数据即使是整数,可以这样写 int(x+0.5)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
/* *********************************************** Author :111qqz Created Time :2015年12月01日 星期二 23时20分45秒 File Name :code/cf/#334/A.cpp ************************************************ */ #include <cstdio> #include <cstring> #include <iostream> #include <algorithm> #include <vector> #include <queue> #include <set> #include <map> #include <string> #include <cmath> #include <cstdlib> #include <ctime> #define fst first #define sec second #define lson l,m,rt<<1 #define rson m+1,r,rt<<1|1 #define ms(a,x) memset(a,x,sizeof(a)) typedef long long LL; using namespace std; const double eps = 1E-8; const int dx4[4]={1,0,0,-1}; const int dy4[4]={0,-1,1,0}; const int inf = 0x3f3f3f3f; const int N=10; int m[N]; int w[10]; int hs,hu; int s[10]={500,1000,1500,2000,2500}; int main() { #ifndef ONLINE_JUDGE freopen("code/in.txt","r",stdin); #endif for ( int i = 0 ; i < 5 ; i++) scanf("%d",&m[i]); for ( int i = 0 ; i < 5 ; i++) scanf("%d",&w[i]); scanf("%d %d",&hs,&hu); int ans = 0 ; for ( int i = 0 ; i < 5 ; i++) { ans = ans +max(s[i]*3/10,s[i]-m[i]*s[i]/250-50*w[i]); // ans = ans+ max(int(0.3*s[i]),s[i]-m[i]*s[i]/250-50*w[i]); 会WA test6 } ans = ans + hs*100; ans = ans - hu*50; cout<<ans<<endl; #ifndef ONLINE_JUDGE fclose(stdin); #endif return 0; } |
说点什么
您将是第一位评论人!