結果

問題 No.741 AscNumber(Easy)
ユーザー hedwig100hedwig100
提出日時 2020-04-26 15:37:49
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 997 ms / 2,000 ms
コード長 507 bytes
コンパイル時間 277 ms
コンパイル使用メモリ 82,264 KB
実行使用メモリ 227,088 KB
最終ジャッジ日時 2024-04-28 15:59:42
合計ジャッジ時間 16,605 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
52,568 KB
testcase_01 AC 38 ms
53,160 KB
testcase_02 AC 38 ms
53,040 KB
testcase_03 AC 39 ms
52,620 KB
testcase_04 AC 39 ms
53,748 KB
testcase_05 AC 39 ms
53,416 KB
testcase_06 AC 38 ms
52,276 KB
testcase_07 AC 39 ms
52,360 KB
testcase_08 AC 38 ms
52,432 KB
testcase_09 AC 39 ms
53,188 KB
testcase_10 AC 40 ms
52,272 KB
testcase_11 AC 39 ms
53,220 KB
testcase_12 AC 39 ms
52,676 KB
testcase_13 AC 39 ms
53,172 KB
testcase_14 AC 39 ms
53,704 KB
testcase_15 AC 39 ms
53,184 KB
testcase_16 AC 40 ms
52,468 KB
testcase_17 AC 40 ms
53,076 KB
testcase_18 AC 39 ms
53,164 KB
testcase_19 AC 40 ms
53,484 KB
testcase_20 AC 47 ms
61,396 KB
testcase_21 AC 46 ms
61,220 KB
testcase_22 AC 49 ms
61,668 KB
testcase_23 AC 48 ms
61,972 KB
testcase_24 AC 46 ms
60,788 KB
testcase_25 AC 48 ms
63,392 KB
testcase_26 AC 47 ms
61,996 KB
testcase_27 AC 47 ms
61,076 KB
testcase_28 AC 45 ms
61,568 KB
testcase_29 AC 48 ms
61,992 KB
testcase_30 AC 49 ms
62,416 KB
testcase_31 AC 49 ms
62,660 KB
testcase_32 AC 45 ms
59,684 KB
testcase_33 AC 48 ms
63,296 KB
testcase_34 AC 48 ms
62,012 KB
testcase_35 AC 969 ms
219,884 KB
testcase_36 AC 459 ms
139,244 KB
testcase_37 AC 530 ms
150,608 KB
testcase_38 AC 512 ms
148,952 KB
testcase_39 AC 450 ms
137,784 KB
testcase_40 AC 579 ms
160,244 KB
testcase_41 AC 871 ms
207,208 KB
testcase_42 AC 489 ms
145,904 KB
testcase_43 AC 376 ms
126,884 KB
testcase_44 AC 706 ms
178,952 KB
testcase_45 AC 752 ms
186,832 KB
testcase_46 AC 924 ms
212,656 KB
testcase_47 AC 203 ms
99,452 KB
testcase_48 AC 928 ms
212,760 KB
testcase_49 AC 784 ms
190,340 KB
testcase_50 AC 153 ms
91,792 KB
testcase_51 AC 389 ms
129,168 KB
testcase_52 AC 996 ms
226,800 KB
testcase_53 AC 997 ms
227,088 KB
testcase_54 AC 988 ms
225,504 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 10**9 + 7
n = int(input())
ans = 10
dp = [[0] * 10 for _ in range(n + 1)]
dp[1] = [1]*10
for i in range(2,n + 1):
    for j in range(10):
        if i == 2:
            for k in range(1,j + 1):
                dp[i][j] += dp[i - 1][k]
                dp[i][j] %= MOD
            ans += dp[i][j]
            ans %= MOD
        else:
            for k in range(j + 1):
                dp[i][j] += dp[i - 1][k]
                dp[i][j] %= MOD
            ans += dp[i][j]
            ans %= MOD
print(ans)
0