- 博客(5)
- 收藏
- 关注
转载 2017百度之星资格赛 1003:度度熊与邪恶大魔王
Problem:度度熊为了拯救可爱的公主,于是与邪恶大魔王战斗起来。 邪恶大魔王的麾下有n个怪兽,每个怪兽有a[i]的生命值,以及b[i]的防御力。 度度熊一共拥有m种攻击方式,第i种攻击方式,需要消耗k[i]的晶石,造成p[i]点伤害。 当然,如果度度熊使用第i个技能打在第j个怪兽上面的话,会使得第j个怪兽的生命值减少p[i]-b[j],当然如果伤害小于防御,那么攻击...
2017-10-14 20:00:00 142
转载 leetcode42. Trapping Rain Water
Givennnon-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining. For example,Given[0,1,0,2,1,0,1,3,2,1,2...
2017-10-06 17:20:00 101
转载 leetcode135. Candy
There areNchildren standing in a line. Each child is assigned a rating value. You are giving candies to these children subjected to the following requirements: Each child must have at least...
2017-10-05 19:08:00 116
转载 leetcode68. Text Justification
Given an array of words and a lengthL, format the text such that each line has exactlyLcharacters and is fully (left and right) justified. You should pack your words in a greedy approach; tha...
2017-10-03 18:34:00 118
转载 找出一定范围内多个连续整数,使其立方之和恰好等于另一个整数的立方
题目如图,关于这道题的第一问比较简单,只需验证式子两边是否相等即可。这里主要做一下第二问。 此题要求找出多个连续正整数,使其立方和恰好等于另一个正整数的立方,因为并没有明确给出相应的条件,比如起始项,项数等,所以找出所有结果并不现实。故将起始项a范围定位1~1000,项数n<=1000。 具体的实现思路很简单,先由两个for循环分别确定起始项和项数,通过立方和公式(...
2017-09-23 12:53:00 267
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人