tHackerrank Fight the Monsters!Week of Code 32
B.Fight the Monsters!
题目链接
题意:有n个怪兽,每个怪兽有h[i]的血量,每次攻击力为hti,一次耗时1秒,问t秒时,最多消灭多少怪兽;
题解:水题,直接排序,怪兽从小向大计算时间,统计怪数个数;
Code:
#include
#define ll long long
using namespace std;
int n;
ll h[100005],cnt,h
原创
2017-05-17 01:38:33 ·
230 阅读 ·
0 评论