思路:模拟一下就可以了
#include<bits\stdc++.h>
using namespace std;
int n,t;
double a[15][15];
void work()
{
a[1][1]+=1;
for(int i = 1;i<=n;i++)
{
for(int j = 1;j<=i;j++)
{
if(a[i][j]<=1)
continue;
double p = a[i][j]-1;
a[i][j]=1;
a[i+1][j]+=p/2;
a[i+1][j+1]+=p/2;
}
}
}
int main()
{
scanf("%d%d",&n,&t);
for(int i = 1;i<=t;i++)
work();
int ans = 0;
for(int i = 1;i<=n;i++)
{
for(int j = 1;j<=i;j++)
{
if(a[i][j]>=0.9999)
ans++;
}
}
printf("%d\n",ans);
}