10313 - Pay the Price
来源:互联网 发布:妖精的口袋淘宝 编辑:程序博客网 时间:2024/05/01 00:28
描述:要用到Ferrers图算法,看了一下似懂非懂,通过别人的代码,也似乎看懂了#include <cstdio>#include <cstring>long long v[310][310]= {{0}};void dp(){ v[0][0]=1; for(int i=0; i<=300; i++) for(int j=1; j<=300; j++) { if(i>=j) v[i][j]+=v[i-j][j]; v[i][j]+=v[i][j-1]; }}int main(){ // freopen("a.txt","r",stdin); dp(); int n,m,k,flag; char s[110]; while(gets(s)) { m=k=flag=-1; sscanf(s,"%d%d%d",&n,&m,&k); if(m>300) m=300; if(k>300) k=300; if(m==-1) printf("%lld\n",v[n][n]); else if(k==-1) printf("%lld\n",v[n][m]); else { if(m>=1) printf("%lld\n",v[n][k]-v[n][m-1]); else printf("%lld\n",v[n][k]); } } return 0;}
- 10313 - Pay the Price
- 10313 - Pay the Price
- uva 10313 Pay the Price
- UVA 10313 Pay the Price
- UVA 10313 Pay the Price
- uva 10313 - Pay the Price
- UVA - 10313 Pay the Price
- UVa:10313 Pay the Price
- uva 10313 - Pay the Price
- UVa 10313 - Pay the Price
- UVA - 10313 Pay the Price
- UVA - 10313 Pay the Price
- uva 10313 Pay the Price
- UVA 10313-Pay the Price(DP)
- uva 10313 Pay the Price (DP)
- UVA10313- Pay the Price
- Pay the Price
- Pay the Price+uva+dp
- 如何调试Erlang程序
- 10 rules for a great startup idea
- Thread Static
- HTML 块级元素 内联元素 速查
- window.open的解释。
- 10313 - Pay the Price
- Hibernate get和load区别
- CF 174(div2) D
- Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/mail/util/LineInputStream
- poj_2992 Divisors
- mybatis generator 使用
- hdu2134(切蛋糕)
- 什么时候使用CSS与Table
- S3C6410存储器映射(内存地址等)