Topcoder SRM671

来源:互联网 发布:超市软件安装视频 编辑:程序博客网 时间:2024/06/06 20:35


BearPaints

(1)问题描述:

Limak is a little polar bear. Today he found two things in the snow: a bucket of blue paint and a white rectangular grid with W(1 <= W <= 1000000) times H(1 <= H <= 1000000) square cells.Limak is going to paint some (possibly even all) cells blue. He wants to do it in such a way that the blue cells will form a completely filled blue rectangle. He has enough paint for M(1 <= M <= 1000000000000) cells. What is the largest possible area of a blue rectangle he can paint?


(2)要点:

(3)代码:


BearDartsDiv2

(1)问题描述:

Limak is an old brown bear who likes to play darts.

Limak just picked up an empty scorecard. He then threw a sequence of darts into a dartboard and for each dart he recorded the point value of the area it hit. You are given a int[] w containing the contents of Limak's scorecard: a sequence of point values.

Today there is a special jackpot. In order to win the jackpot, the player must present a scorecard with exactly four scores: (a, b, c, d). Additionally, these scores must be such that a*b*c = d. Note that order matters: the scores a, b, c, d must have been obtained in this particular order.

Limak wants to erase all but four scores from his scorecard in such a way that he will win the jackpot. Compute and return the number of different ways in which he can do that.


(2)要点:

(3)代码:


0 0
原创粉丝点击