結果

問題 No.1681 +-*
ユーザー Mik10
提出日時 2021-10-07 15:35:52
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 250 bytes
コンパイル時間 151 ms
コンパイル使用メモリ 82,480 KB
実行使用メモリ 111,412 KB
最終ジャッジ日時 2024-07-23 03:06:48
合計ジャッジ時間 4,249 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 3 TLE * 1 -- * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
seql = list(map(int, input().split()))
import operator, itertools

z = 10**9+7
n -= 2 
ans = 0
for p in itertools.accumulate(seql, func=operator.mul):
    ans = ans%z + (p * 3**n * 2)%z if n >= 0 else (ans+p)%z
    n -= 1
print (ans)
0