結果

問題 No.741 AscNumber(Easy)
ユーザー prd_xxxprd_xxx
提出日時 2018-10-05 21:44:38
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,671 ms / 2,000 ms
コード長 399 bytes
コンパイル時間 90 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 136,176 KB
最終ジャッジ日時 2024-04-20 17:09:10
合計ジャッジ時間 23,270 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,624 KB
testcase_01 AC 30 ms
10,752 KB
testcase_02 AC 32 ms
10,624 KB
testcase_03 AC 31 ms
10,880 KB
testcase_04 AC 31 ms
10,752 KB
testcase_05 AC 30 ms
10,752 KB
testcase_06 AC 30 ms
10,880 KB
testcase_07 AC 31 ms
10,752 KB
testcase_08 AC 31 ms
10,624 KB
testcase_09 AC 30 ms
10,624 KB
testcase_10 AC 30 ms
10,624 KB
testcase_11 AC 30 ms
10,624 KB
testcase_12 AC 32 ms
10,752 KB
testcase_13 AC 31 ms
10,752 KB
testcase_14 AC 31 ms
10,752 KB
testcase_15 AC 31 ms
10,752 KB
testcase_16 AC 32 ms
10,624 KB
testcase_17 AC 31 ms
10,880 KB
testcase_18 AC 31 ms
10,880 KB
testcase_19 AC 32 ms
10,752 KB
testcase_20 AC 32 ms
10,880 KB
testcase_21 AC 31 ms
10,624 KB
testcase_22 AC 32 ms
10,624 KB
testcase_23 AC 32 ms
10,752 KB
testcase_24 AC 31 ms
10,752 KB
testcase_25 AC 31 ms
10,752 KB
testcase_26 AC 32 ms
10,752 KB
testcase_27 AC 31 ms
10,624 KB
testcase_28 AC 31 ms
10,752 KB
testcase_29 AC 31 ms
10,880 KB
testcase_30 AC 33 ms
10,752 KB
testcase_31 AC 32 ms
10,624 KB
testcase_32 AC 32 ms
10,752 KB
testcase_33 AC 32 ms
10,752 KB
testcase_34 AC 31 ms
11,008 KB
testcase_35 AC 1,556 ms
130,188 KB
testcase_36 AC 675 ms
62,804 KB
testcase_37 AC 787 ms
71,952 KB
testcase_38 AC 776 ms
71,128 KB
testcase_39 AC 646 ms
61,812 KB
testcase_40 AC 907 ms
80,004 KB
testcase_41 AC 1,392 ms
119,832 KB
testcase_42 AC 754 ms
68,408 KB
testcase_43 AC 525 ms
52,428 KB
testcase_44 AC 1,084 ms
95,980 KB
testcase_45 AC 1,187 ms
102,736 KB
testcase_46 AC 1,457 ms
124,468 KB
testcase_47 AC 247 ms
29,908 KB
testcase_48 AC 1,555 ms
124,376 KB
testcase_49 AC 1,229 ms
105,664 KB
testcase_50 AC 168 ms
23,620 KB
testcase_51 AC 612 ms
54,476 KB
testcase_52 AC 1,648 ms
136,176 KB
testcase_53 AC 1,651 ms
135,976 KB
testcase_54 AC 1,671 ms
134,748 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
MOD = 10**9+7

fac = [1,1] + [0]*(N+20)
finv = [1,1] + [0]*(N+20)
inv = [0,1] + [0]*(N+20)
for i in range(2,N+21):
    fac[i] = fac[i-1] * i % MOD
    inv[i] = -inv[MOD%i] * (MOD // i) % MOD
    finv[i] = finv[i-1] * inv[i] % MOD

def ncr(n,r):
    if n < r: return 0
    if n < 0 or r < 0: return 0
    return fac[n] * (finv[r] * finv[n-r] % MOD) % MOD

ans = ncr(N+9,9)
print(ans)
0