【CodeForces】[658A]Bear and Reverse Radewoosh
2016-04-07 21:52
357 查看
根据题意分别计算两人的分值
进行比较就好了
#include<stdio.h> int main() { int n,c; while(scanf("%d %d",&n,&c)!=EOF) { int a[55],q[55]; for(int i=0; i<n; i++) scanf("%d",&a[i]); for(int i=0; i<n; i++) scanf("%d",&q[i]); int sum1=0,sum2=0; int tq=0; for(int i=0; i<n; i++) { tq+=q[i]; int t=a[i]-c*tq; if(t>0) sum1+=t; } tq=0; for(int i=n-1; i>=0; i--) { tq+=q[i]; int t=a[i]-c*tq; if(t>0) sum2+=t; } if(sum1>sum2) printf("Limak\n"); else if(sum1<sum2) printf("Radewoosh\n"); else printf("Tie\n"); } return 0; }
题目地址:【CodeForces】[658A]Bear and Reverse Radewoosh
相关文章推荐
- 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 #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)
- Codeforces #264(div 2)D.Gargari and Permutations
- Codeforces Round #236 (Div. 2)------A,B
- codeforces 257 div2 B
- Codeforces Gym100571A Cursed Query