結果
問題 | No.1681 +-* |
ユーザー |
👑 ![]() |
提出日時 | 2021-09-17 21:43:02 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 162 ms / 2,000 ms |
コード長 | 375 bytes |
コンパイル時間 | 122 ms |
コンパイル使用メモリ | 82,344 KB |
実行使用メモリ | 100,224 KB |
最終ジャッジ日時 | 2024-06-29 20:07:45 |
合計ジャッジ時間 | 3,284 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 18 |
ソースコード
"""最初の掛け算の項以外は、対消滅する"""import sysfrom sys import stdinmod = 10**9+7N = int(stdin.readline())A = list(map(int,stdin.readline().split()))ans = 0now = 1for i in range(N):now *= A[i]now %= modif i == N-1:ans += nowelse:ans += now * 2 * pow(3,N-2-i,mod)ans %= modprint (ans % mod)