/*teammates told the test instructions, probably the Cup title placed, there are n layers. The top of the cup can fill a second, give N and time t, ask t seconds can fill how many cups. The idea is to use a two-dimensional array to simulate the process of a cup leaking down. Finally sweep the array to calculate the number of capacity greater than 1. */#include<cstdio>#include<cstring>#include<algorithm>#include<iostream>#include<string>using namespacestd;intMain () {Doublea[ the][ the]; intn,t; Memset (A,0,sizeof(a)); scanf ("%d%d",&n,&t); a[1][1] =T; for(intI=2; i<=Ten; i++) { for(intj=1; j<=Ten; j + +) { Doublex = (a[i-1][j]>1? (a[i-1][J]-1) :0)/2;//if it's not enough, 1 can't keep leaking if it's not filled. Doubley = (a[i-1][j-1]>1? (a[i-1][j-1] -1) :0)/2; A[I][J]+ = x+y; } } intAns =0; for(intI=1; i<=n;i++) for(intj=1; j<=n;j++) if(a[i][j]>=1) ans++; cout<<ans<<Endl; return 0;}
Codeforces Round #354 (Div. 2)-B. Pyramid of Glasses