結果

問題 No.1681 +-*
ユーザー lllllll88938494
提出日時 2022-09-13 01:36:45
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 268 bytes
コンパイル時間 361 ms
コンパイル使用メモリ 82,180 KB
実行使用メモリ 102,008 KB
最終ジャッジ日時 2024-11-30 04:04:37
合計ジャッジ時間 2,643 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 1
other AC * 4 WA * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
a=list(map(int,input().split()))
ans=0
now=a[0]
mod=10**9+7
for i in range(n):
    if i < n-1:
        ans += now * 2 * max((n-2-i)*3,1)
        now*=a[i+1]
        now%=mod
        ans%=mod
    else:
        ans += now
        ans%=mod

print(ans)
    
0