E - Pyramid of Glasses
来源:互联网 发布:手机点烟软件 编辑:程序博客网 时间:2024/05/20 04:14
模拟
#include<stdio.h>#include<string.h>double dp[15][15];int n,t;void solve(){ dp[1][1]+=1; for(int i=1;i<=n;i++) { for(int j=1;j<=i;j++) { if(dp[i][j]<=1) continue; double p=dp[i][j]-1; dp[i][j]=1; dp[i+1][j]+=p/2; dp[i+1][j+1]+=p/2; } }}int main(){ int ans=0; scanf("%d%d",&n,&t); memset(dp,0,sizeof(dp)); for(int k=1;k<=t;k++) solve(); for(int i=1;i<=n;i++) { for(int j=1;j<=i;j++) { if(dp[i][j]>=1) ans++; } } printf("%d\n",ans); return 0;}
0 0
- E - Pyramid of Glasses
- B. Pyramid of Glasses
- Pyramid of Glasses
- Pyramid of Glasses
- codeforces 676B Pyramid of Glasses 递归
- 【CodeForces 676】B - Pyramid of Glasses
- codeforce 676b Pyramid of Glasses
- Codeforces Round #354 (Div. 2)676B. Pyramid of Glasses
- codeforces 676B Pyramid of Glasses(模拟题)
- Codeforces Round #354 (Div. 2)-Pyramid of Glasses
- Codeforces 354 B Pyramid of Glasses (dp)
- Codeforces Round #354 (Div. 2) Pyramid of Glasses
- CodeForces 676B Pyramid of Glasses(举杯斟酒)
- CodeForces 676 B. Pyramid of Glasses(模拟)
- Pyramid of Glasses 酒杯金字塔 [CF-676B]
- Codeforces Round #354 (Div. 2) B Pyramid of Glasses(模拟)
- Codeforces Round #354 (Div. 2)B.Pyramid of Glasses(思维题)
- CodeForces 676B Pyramid of Glasses【杨辉三角倒鸡尾酒】
- 关于微信的第三方登录
- D - Joty and Chocolate
- Vue.js学习 Item5 -- 计算属性computed与$watch
- 如何使用canvas画连续的线段
- JavaScript基础——强大的数组
- E - Pyramid of Glasses
- Java输入输出流 结构详解
- 欢迎使用CSDN-markdown编辑器
- Java 利用 ICC 色彩空间 color space profile 实现 RGB 和 CMYK 颜色的相互转换
- eclipse自动补全
- Linux的僵尸进程产生原因及解决方法
- Vue.js学习 Item6 -- Class 与 样式绑定
- select下拉列表的级联
- 263. Ugly Number