結果

問題 No.189 SUPER HAPPY DAY
ユーザー convexineqconvexineq
提出日時 2020-12-17 18:17:17
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 97 ms / 5,000 ms
コード長 490 bytes
コンパイル時間 159 ms
コンパイル使用メモリ 81,772 KB
実行使用メモリ 70,700 KB
最終ジャッジ日時 2023-10-21 07:00:53
合計ジャッジ時間 2,732 ms
ジャッジサーバーID
(参考情報)
judge9 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 48 ms
59,964 KB
testcase_01 AC 48 ms
59,964 KB
testcase_02 AC 48 ms
59,964 KB
testcase_03 AC 48 ms
59,964 KB
testcase_04 AC 48 ms
59,964 KB
testcase_05 AC 49 ms
59,964 KB
testcase_06 AC 49 ms
59,964 KB
testcase_07 AC 48 ms
59,964 KB
testcase_08 AC 50 ms
59,964 KB
testcase_09 AC 47 ms
59,964 KB
testcase_10 AC 47 ms
59,964 KB
testcase_11 AC 48 ms
59,964 KB
testcase_12 AC 47 ms
59,964 KB
testcase_13 AC 74 ms
66,412 KB
testcase_14 AC 80 ms
68,460 KB
testcase_15 AC 74 ms
66,608 KB
testcase_16 AC 74 ms
66,596 KB
testcase_17 AC 81 ms
68,656 KB
testcase_18 AC 77 ms
66,604 KB
testcase_19 AC 86 ms
68,672 KB
testcase_20 AC 61 ms
64,548 KB
testcase_21 AC 67 ms
66,416 KB
testcase_22 AC 52 ms
62,272 KB
testcase_23 AC 71 ms
66,592 KB
testcase_24 AC 72 ms
66,592 KB
testcase_25 AC 97 ms
70,700 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def get(s):
    N = 2000
    le = [0]*N
    eq = 0
    for i in s:
        d = int(i)
        nle = [0]*N
        for j in range(10):
            for k in range(N-j):
                nle[k+j] += le[k]
                nle[k+j] %= MOD
        for j in range(d):
            nle[j+eq] += 1
        eq += d
        le = nle
    le[eq] += 1
    le[0] -= 1
    return le

MOD = 10**9+9
m,n = input().split()
rm = get(m)
rn = get(n)
ans = 0
for i,j in zip(rm,rn):
    ans += i*j%MOD
print(ans%MOD)
0