結果
| 問題 |
No.1681 +-*
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-09-19 15:01:29 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 192 ms / 2,000 ms |
| コード長 | 229 bytes |
| コンパイル時間 | 219 ms |
| コンパイル使用メモリ | 82,432 KB |
| 実行使用メモリ | 101,888 KB |
| 最終ジャッジ日時 | 2024-07-01 18:13:31 |
| 合計ジャッジ時間 | 4,674 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 18 |
ソースコード
N = int(input())
L = list(map(int,input().split()))
ans = 0
mod = 10**9 + 7
now = L[0]
for i in range(N-1):
ans += now * 2 * pow(3,N-2-i,mod)
ans %= mod
now *= L[i+1]
now %= mod
#print(ans)
print((ans + now)%mod)