Created
October 11, 2010 08:39
-
-
Save wasabili/620217 to your computer and use it in GitHub Desktop.
Bingo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<cstdio> | |
#include<cstring> | |
#define S_MAX 3001 | |
#define M_MAX 2001 | |
int dp[S_MAX][M_MAX]; | |
main(){ | |
while(1){ | |
int n,m,s; | |
scanf("%d%d%d",&n,&m,&s); | |
if(n==0) return 0; | |
memset(dp, '\0', sizeof(dp)); | |
for(int k=1;k<=s;k++) for(int i=1;i<=m;i++) if(i>=k) dp[k][i] = 1; | |
int i,j,k; | |
for(i=1;i<n*n;i++) | |
for(k=s;k>=1;k--) | |
for(j=1;j<=m;j++) | |
if(k>=j) dp[k][j] = (dp[k-j][j-1]+dp[k][j-1])%100000; | |
else dp[k][j] = dp[k][j-1]; | |
printf("%d\n",dp[s][m]); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, im interested in using this, can you please tell me how to make it work on tampermonkey?
email me @ marineoverlord@gmail.com