結果

問題 No.797 Noelちゃんとピラミッド
ユーザー mukadenodaiou
提出日時 2019-03-17 23:07:13
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
RE  
実行時間 -
コード長 290 bytes
コンパイル時間 215 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 18,832 KB
最終ジャッジ日時 2024-07-08 01:54:17
合計ジャッジ時間 4,268 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample RE * 3
other TLE * 1 -- * 59
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


MOD = int(1e9+7)
n = int(input())
combs=[comb(n-1,i) for i in range(n-1)]
a = input().split()
ans = 0
for i,j in enumerate(a):
    ans += int(j)*combs[int(i)]
    ans %= MOD
print(ans)
0