Skip to content

Instantly share code, notes, and snippets.

@wasabili
Created October 11, 2010 08:39
Show Gist options
  • Save wasabili/620217 to your computer and use it in GitHub Desktop.
Save wasabili/620217 to your computer and use it in GitHub Desktop.
Bingo
#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]);
}
}
@Charmand3r
Copy link

Hi, im interested in using this, can you please tell me how to make it work on tampermonkey?
email me @ marineoverlord@gmail.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment