結果
問題 |
No.797 Noelちゃんとピラミッド
|
ユーザー |
![]() |
提出日時 | 2019-03-15 22:55:12 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 303 bytes |
コンパイル時間 | 155 ms |
コンパイル使用メモリ | 81,964 KB |
実行使用メモリ | 170,008 KB |
最終ジャッジ日時 | 2024-07-01 21:24:28 |
合計ジャッジ時間 | 4,083 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | TLE * 1 -- * 59 |
ソースコード
from math import factorial N = int(input()) A = list(map(int,input().split())) z = factorial(N-1) % (10**9+7) ans = A[0] + A[-1] for i in range(1,N-1) : x = factorial(i) % (10**9+7) y = factorial(N-1-i) % (10**9+7) xy = (x*y) % (10**9+7) comb = z//xy ans += comb*A[i] print(ans)