結果

問題 No.741 AscNumber(Easy)
ユーザー brthyyjpbrthyyjp
提出日時 2021-06-25 16:56:41
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 205 ms / 2,000 ms
コード長 438 bytes
コンパイル時間 1,530 ms
コンパイル使用メモリ 86,768 KB
実行使用メモリ 107,964 KB
最終ジャッジ日時 2023-09-07 13:38:01
合計ジャッジ時間 10,537 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 117 ms
107,568 KB
testcase_01 AC 121 ms
107,568 KB
testcase_02 AC 118 ms
107,620 KB
testcase_03 AC 118 ms
107,776 KB
testcase_04 AC 118 ms
107,628 KB
testcase_05 AC 117 ms
107,556 KB
testcase_06 AC 117 ms
107,632 KB
testcase_07 AC 117 ms
107,808 KB
testcase_08 AC 117 ms
107,884 KB
testcase_09 AC 117 ms
107,812 KB
testcase_10 AC 116 ms
107,572 KB
testcase_11 AC 115 ms
107,540 KB
testcase_12 AC 118 ms
107,708 KB
testcase_13 AC 118 ms
107,556 KB
testcase_14 AC 117 ms
107,732 KB
testcase_15 AC 117 ms
107,664 KB
testcase_16 AC 118 ms
107,676 KB
testcase_17 AC 117 ms
107,612 KB
testcase_18 AC 118 ms
107,808 KB
testcase_19 AC 120 ms
107,572 KB
testcase_20 AC 120 ms
107,444 KB
testcase_21 AC 122 ms
107,440 KB
testcase_22 AC 120 ms
107,440 KB
testcase_23 AC 119 ms
107,820 KB
testcase_24 AC 116 ms
107,460 KB
testcase_25 AC 118 ms
107,664 KB
testcase_26 AC 123 ms
107,460 KB
testcase_27 AC 121 ms
107,816 KB
testcase_28 AC 120 ms
107,664 KB
testcase_29 AC 119 ms
107,660 KB
testcase_30 AC 120 ms
107,664 KB
testcase_31 AC 121 ms
107,812 KB
testcase_32 AC 119 ms
107,780 KB
testcase_33 AC 121 ms
107,612 KB
testcase_34 AC 121 ms
107,488 KB
testcase_35 AC 202 ms
107,752 KB
testcase_36 AC 155 ms
107,740 KB
testcase_37 AC 159 ms
107,760 KB
testcase_38 AC 157 ms
107,584 KB
testcase_39 AC 154 ms
107,584 KB
testcase_40 AC 163 ms
107,616 KB
testcase_41 AC 191 ms
107,964 KB
testcase_42 AC 155 ms
107,764 KB
testcase_43 AC 151 ms
107,932 KB
testcase_44 AC 173 ms
107,800 KB
testcase_45 AC 176 ms
107,828 KB
testcase_46 AC 190 ms
107,732 KB
testcase_47 AC 131 ms
107,768 KB
testcase_48 AC 189 ms
107,772 KB
testcase_49 AC 181 ms
107,756 KB
testcase_50 AC 130 ms
107,616 KB
testcase_51 AC 148 ms
107,792 KB
testcase_52 AC 201 ms
107,812 KB
testcase_53 AC 205 ms
107,848 KB
testcase_54 AC 201 ms
107,764 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = 2*10**6
mod = 10**9+7
fac = [1]*(N+1)
finv = [1]*(N+1)
for i in range(N):
    fac[i+1] = fac[i] * (i+1) % mod
finv[-1] = pow(fac[-1], mod-2, mod)
for i in reversed(range(N)):
    finv[i] = finv[i+1] * (i+1) % mod

def cmb1(n, r, mod):
    if r <0 or r > n:
        return 0
    r = min(r, n-r)
    return fac[n] * finv[r] * finv[n-r] % mod

n = int(input())
ans = 1
for i in range(1, n+1):
    ans += cmb1(i+8, 8, mod)
print(ans%mod)
0