prepare for the provincial time --10.1--Hard to Play
来源:互联网 发布:js左右滑动图片轮播 编辑:程序博客网 时间:2024/05/26 19:18
Hard to Play
这是第十届省赛题目中通过率最高的一道题目,不能更简单。昨天做的,训练第一天。
题意:题目分别给出某个人在一场游戏中得到300、100、50分的局数,然后给出计算游戏总得分的公式,根据这个公式,在越靠后的局数,这一局的分数乘以的倍数最大。问通过这种计算方式,这个人可能得到的最大游戏总得分和最少的游戏总得分。
思路没什么,最大的分就把大的分数往后放,最少得分就把小的分数往靠后的局数放。
细节+代码:
#include<stdio.h>int main(){int T,i,j,a,b,c,sum,minscore,maxscore;scanf("%d",&T);for(i = 1;i<=T;i++){scanf("%d%d%d",&a,&b,&c);sum = a+b+c;maxscore = 0;for(j = sum-1;j>=sum-a;j--)maxscore = maxscore+300*(j*2+1);for(j = sum-a-1;j>=sum-a-b;j--)maxscore = maxscore+100*(j*2+1);for(j = sum-a-b-1;j>=sum-a-b-c;j--)maxscore = maxscore+50*(j*2+1);sum = a+b+c;minscore = 0;for(j = sum-1;j>=sum-c;j--)minscore = minscore+50*(j*2+1);for(j = sum-c-1;j>=sum-c-b;j--) minscore = minscore+100*(j*2+1);for(j = sum-c-b-1;j>=sum-a-b-c;j--)minscore = minscore+300*(j*2+1);printf("%d %d\n",minscore,maxscore);}}
0 0
- prepare for the provincial time --10.1--Hard to Play
- prepare for the provincial time --10.5--Friends
- prepare for the provincial time --9.2--Taxi Fare
- prepare for the provincial time --10.2--Density of Power Network
- prepare for the provincial time --10.4-- Java Beans
- prepare for the provincial time –10.6-- In 7-bit
- prepare for the provincial time --9.1-- Yet Another Story of Rock-paper-scissors
- preapre for the provincial time --10.3--Break Standard Weight
- ZOJ3712:Hard to Play
- Hard to Play
- Hard to Play
- Hard to Play
- H. Hard to Play
- ZOJ-Hard to Play
- How to prepare the docs for a sw development project
- zoj 3712 Hard to Play
- zju 3712 Hard to Play
- ZOJ 3712 Hard to Play
- zoj 3633 Alice's present(离线+线段树)
- Ubuntu安装android
- C语言 ANSI-C内存管理API函数整理
- android横竖屏切换时候Activity的生命周期
- gedit配置
- prepare for the provincial time --10.1--Hard to Play
- 解决ORACLE锁表问题
- 三角形1
- Jsp表单测试-checkbox获取,radio获取
- c++如何查询变量的类型
- iOS speex 配置
- Tomcat学习之二:tomcat安装、配置及目录文件说明
- 生理周期(中国剩余定理)
- IT思想题