hiho week 198 register

Ended

Participants:172

Verdict:Accepted
Score:100 / 100
Submitted:2018-04-21 18:43:35

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <cstring>
#include <cstdio>
#include <iostream>
using namespace std;
const int mod=1000000007;
int f[55][11][55];
int dp[105][55];
int c[105][105];
int have[105];
char str[105];
char you[105];
void update(int &x,int y){
    x=(x+y)%mod;
}
void yu(){
    memset(f,0,sizeof(f));
    f[0][0][0]=1;
    for (int k=1;k<=50;k++){
        for (int i=0;i<=9;i++){
            for (int j=0;j<=50;j++){
                for (int x=1;x<=9;x++){
                    update(f[k][(i+x)%10][j+(x+i)/10],f[k-1][i][j]);
                }
            }
        }
    }
    c[0][0]=1;
    for (int i=1;i<=100;i++){
        c[i][0]=c[i][i]=1;
        for (int j=1;j<i;j++){
            update(c[i][j],(c[i-1][j]+c[i-1][j-1])%mod);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX