CF 676B Pyramid of Glasses[模拟]】的更多相关文章

B. Pyramid of Glasses time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Mary has just graduated from one well-known University and is now attending celebration party. Students like to dream o…
题目链接:http://codeforces.com/problemset/problem/676/B 题意:一个n层的平面酒杯金字塔,如图,每个杯子的容量相同.现在往最顶部的一个杯子倒 t 杯酒,求流动结束后有多少个杯子被装满. 思路:每个局部的两代三个杯子的流动过程是一致的,因此可以用递归来模拟求解. 具体为:设add(cur, i, l)执行“往第 i 个杯子倒cur量的酒”,附加信息: i 位于第 l 层.若执行完剩余了surplus量的酒,则往 i 的下一层左右两侧的杯子各倒surpl…
题目链接: B. Pyramid of Glasses time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Mary has just graduated from one well-known University and is now attending celebration party. Students like to d…
B. Pyramid of Glasses 题目连接: http://www.codeforces.com/contest/676/problem/B Description 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…
原题链接 B. Pyramid of Glasses 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 pyram…
Pyramid of Glasses time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Mary has just graduated from one well-known University and is now attending celebration party. Students like to dream of a…
题目连接:http://codeforces.com/contest/676/problem/B 题意:给你一个N层的杯子堆成的金字塔,倒k个杯子的酒,问倒完后有多少个杯子的酒是满的 题解:由于数据不是很大,直接模拟就行了 #include<cstdio> #include<cstring> #define F(i,a,b) for(int i=a;i<=b;++i) ][],eps=1e-,p;int n,k,ans; void fuck(){ a[][]+=; F(i,,…
[链接]:CF [代码]: #include<bits/stdc++.h> #define PI acos(-1.0) #define pb push_back #define F first #define S second #define debug puts #define setp cout << fixed << setprecision(3) #define FAST_IO ios::sync_with_stdio(false);cin.tie(0);cou…
C. Thor time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Thor is getting used to the Earth. As a gift Loki gave him a smartphone. There are napplications on this phone. Thor is fascinated b…
题目链接:http://codeforces.com/problemset/problem/676/B 递推,dp(i, j)表示第i层第j个杯子,从第一层开始向下倒,和数塔一样的题.每个杯子1个时间能倒满,从上开始向下倒时间为t,那每个杯子不满的时候对下面的贡献一定是0,所以当dp[i][j]>=1的时候,计数倒满的杯子并且将溢出的酒向下平分. /* ━━━━━┒ギリギリ♂ eye! ┓┏┓┏┓┃キリキリ♂ mind! ┛┗┛┗┛┃\○/ ┓┏┓┏┓┃ / ┛┗┛┗┛┃ノ) ┓┏┓┏┓┃ ┛┗…