結果

問題 No.797 Noelちゃんとピラミッド
ユーザー mlihua09
提出日時 2020-09-17 17:26:00
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 154 ms / 2,000 ms
コード長 241 bytes
コンパイル時間 362 ms
コンパイル使用メモリ 82,128 KB
実行使用メモリ 91,020 KB
最終ジャッジ日時 2024-06-22 06:41:23
合計ジャッジ時間 8,248 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 60
権限があれば一括ダウンロードができます

ソースコード

diff #


N = int(input())

ans = 0

A = list(map(int, input().split()))

mod = 10 ** 9 + 7

x = 1

for i in range(N - 1, -1, -1):
    
    ans += A[i] * x
    ans %= mod
    x *= i
    x *= pow(N - i, mod - 2, mod)
    x %= mod
    
    
print(ans)
0