結果
問題 |
No.1681 +-*
|
ユーザー |
|
提出日時 | 2021-09-17 22:24:54 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 367 bytes |
コンパイル時間 | 144 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 33,392 KB |
最終ジャッジ日時 | 2024-06-29 21:03:25 |
合計ジャッジ時間 | 4,544 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 4 WA * 14 |
ソースコード
n = int(input()) a = list(map(int,input().split())) e = 1000000007 alist = [] three = [] temp = 1 th = 1 for i in range(n): #temp = temp*a[i] #alist.append(temp) three.append(th) th = th*3%e #print(three) ans = 0 for j in range(n-1): temp = temp*a[j]%e ans += (temp*2*three[n-2-j])%e temp = temp*(a[n-1]%e)%e ans = (ans+temp%e) print(ans)