Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
这样那里错了,和过得代码对数据都一样啊!!!#include<iostream> #include<algorithm> using namespace std; int map[15][15],sign[15][15]; int main() { int i,j,k,n,m; memset(map,0,sizeof(map)); memset(sign,0,sizeof(sign)); map[0][0]=1; for(i=1;i<=14;i++) { for(j=1;j<=14;j++) { map[j][i]=map[j-1][i-1]+map[j-i][i]; } } for(i=1;i<=14;i++) { for(j=1;j<=14;j++) { sign[i][j]=sign[i][j-1]+map[i][j]; } } scanf("%d",&k); while(k--) { scanf("%d%d",&m,&n); printf("%d\n",sign[m][n]); } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator