結果
| 問題 | 
                            No.1681 +-*
                             | 
                    
| コンテスト | |
| ユーザー | 
                             lllllll88938494
                         | 
                    
| 提出日時 | 2022-09-13 01:36:42 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 268 bytes | 
| コンパイル時間 | 300 ms | 
| コンパイル使用メモリ | 82,372 KB | 
| 実行使用メモリ | 102,316 KB | 
| 最終ジャッジ日時 | 2024-11-30 04:04:21 | 
| 合計ジャッジ時間 | 3,657 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 WA * 1 | 
| other | AC * 4 WA * 14 | 
ソースコード
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)
    
            
            
            
        
            
lllllll88938494