CF676B.Pyramid of Glasses
普及/提高-
通过率:0%
时间限制:1.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Mary has just graduated from one well-known University and is now attending celebration party. Students like to dream of a beautiful life, so they used champagne glasses to construct a small pyramid. The height of the pyramid is n. The top level consists of only 1 glass, that stands on 2 glasses on the second level (counting from the top), then 3 glasses on the third level and so on.The bottom level consists of n glasses.
Vlad has seen in the movies many times how the champagne beautifully flows from top levels to bottom ones, filling all the glasses simultaneously. So he took a bottle and started to pour it in the glass located at the top of the pyramid.
Each second, Vlad pours to the top glass the amount of champagne equal to the size of exactly one glass. If the glass is already full, but there is some champagne flowing in it, then it pours over the edge of the glass and is equally distributed over two glasses standing under. If the overflowed glass is at the bottom level, then the champagne pours on the table. For the purpose of this problem we consider that champagne is distributed among pyramid glasses immediately. Vlad is interested in the number of completely full glasses if he stops pouring champagne in t seconds.
Pictures below illustrate the pyramid consisting of three levels.

玛丽刚刚从一所知名大学毕业,正在参加庆祝派对。学生们喜欢憧憬美好的生活,因此他们用香槟杯搭起了一座小金字塔。金字塔的高度为 n。顶层仅有 1 个杯子,它位于第二层(从顶部开始计数)的 2 个杯子之上,第三层有 3 个杯子,依此类推。最底层共有 n 个杯子。
弗拉德在电影中多次看到香槟如何优美地从顶层逐级流到底层,同时填满所有杯子。于是他拿起一瓶香槟,开始将香槟注入金字塔顶端的那个杯子中。
每秒钟,弗拉德向顶端的杯子注入恰好等于一个杯子容量的香槟量。如果该杯子已满,但仍有香槟继续注入,则多余的香槟会从杯沿溢出,并被平均分配到其正下方的两个杯子中。若发生溢出的杯子位于最底层,则溢出的香槟直接流到桌面上。本题中,我们假定香槟在金字塔杯子之间的分配是瞬时完成的。弗拉德想知道:若他在 t 秒后停止注入香槟,此时共有多少个杯子被完全装满?
下图展示了由三层组成的金字塔:

输入格式
The only line of the input contains two integers n and t (1 ≤ n ≤ 10, 0 ≤ t ≤ 10 000) — the height of the pyramid and the number of seconds Vlad will be pouring champagne from the bottle.
输入仅包含一行,有两个整数 n 和 t(1 ≤ n ≤ 10,0 ≤ t ≤ 10000)——分别表示金字塔的高度以及弗拉德从酒瓶中倾倒香槟的秒数。
输出格式
Print the single integer — the number of completely full glasses after t seconds.
输出一个整数——即 t 秒后完全装满的杯子数量。
输入输出样例
输入#1
3 5
输出#1
4
输入#2
4 8
输出#2
6
说明/提示
In the first sample, the glasses full after 5 seconds are: the top glass, both glasses on the second level and the middle glass at the bottom level. Left and right glasses of the bottom level will be half-empty.
在第一个样例中,5 秒后装满的杯子有:最顶端的杯子、第二层的两个杯子,以及最底层的中间杯子。最底层的左侧和右侧杯子将各装有一半水。
输入解题思路,AI测评打分。不知道怎么写?