【CodeForces 676】B - Pyramid of Glasses
这道题我真的想吐血。。
感觉是数学题。。
结果傻逼模拟。。
坑了我1个小时。。
#include<bits/stdc++.h>
using namespace std;
int n,t,day = 0;
int dp[11][11];
int res[11][11];
int main(void)
{
cin>>n>>t;
int pos = 1<<(n+1);
while(1)
{
if(day>=t)break;
memset(res,0,sizeof(res));
res[1][1] = 1<<(n+1);
for(int i=1;i<=n;i++)
{
for(int j=1;j<=i;j++)
{
if(dp[i][j]==pos)
{
res[i+1][j]+=res[i][j]>>1;
res[i+1][j+1]+=res[i][j]>>1;
}
else
{
dp[i][j]+=res[i][j];
if(dp[i][j]>pos)
{
res[i][j] = dp[i][j] - pos;
dp[i][j] = pos;
res[i+1][j] += res[i][j]>>1;
res[i+1][j+1] += res[i][j]>>1;
}
}
}
}
++day;
}
int cnt = 0;
for(int i=1;i<