tjut 4310
来源:互联网 发布:10月份经济数据2017 编辑:程序博客网 时间:2024/05/17 04:06
#include<iostream>#include<algorithm>using namespace std;struct Dota{ double DPS; double HP;}hero[50];bool cmp(Dota h1,Dota h2){ return h1.DPS/h1.HP>h2.DPS/h2.HP;}int main(){ int n,i; __int64 sum,total; while(~scanf("%d",&n)) { total=0; for(i=0;i<n;i++) { scanf("%lf %lf",&hero[i].HP,&hero[i].DPS);//质疑先输入血量还是伤害值? total+=hero[i].DPS; } sort(hero,hero+n,cmp); sum=0; for(i=0;i<n;i++) { sum+=hero[i].HP*total; total-=hero[i].DPS; } printf("%I64d\n",sum); } return 0;}
0 0
- tjut 4310
- tjut 5289
- tjut 5288
- tjut 5294
- tjut 2586
- tjut 5296
- tjut 5297
- tjut 5299
- tjut 5384
- tjut 5387
- tjut 5386
- tjut 5381
- tjut 5400
- tjut 5399
- tjut 5396
- tjut 5398
- tjut 5412
- tjut 5410
- 符号表
- Music app框架设计及总结
- spring容器归纳(二)
- Linux命令 - su
- datetimepicker用法
- tjut 4310
- 猜数字游戏
- Python 程序扩展名(py, pyc, pyw, pyo, pyd)及发布程序时的选择
- 不可以! 南阳理工ACM 题目1071
- 《机器学习》周志华学习笔记——第一章 绪论
- Spring Security 3.1 中功能强大的加密工具 PasswordEncoder
- 捋一捋Android的转场动画
- 重新认识 MVC 和 三层设计模式
- iOSweex集成入门,weex快速上手教程,weex集成到iOS工程注意事项(一)