結果

問題 No.1681 +-*
ユーザー irumo8202irumo8202
提出日時 2022-01-27 10:55:43
言語 PyPy3
(7.3.15)
結果
MLE  
実行時間 -
コード長 287 bytes
コンパイル時間 1,509 ms
コンパイル使用メモリ 86,620 KB
実行使用メモリ 842,072 KB
最終ジャッジ日時 2023-08-26 05:01:44
合計ジャッジ時間 6,013 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 65 ms
71,512 KB
testcase_01 AC 62 ms
71,388 KB
testcase_02 AC 63 ms
71,516 KB
testcase_03 AC 64 ms
71,172 KB
testcase_04 AC 67 ms
71,340 KB
testcase_05 AC 207 ms
112,576 KB
testcase_06 AC 195 ms
113,472 KB
testcase_07 AC 204 ms
107,128 KB
testcase_08 MLE -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import accumulate

MOD = 10 ** 9 + 7
N = int(input())
A = list(map(int, input().split()))

accA = list(accumulate(A, lambda a, b: a * b))

ans = 0

for i in range(N - 1):
    ans += accA[i] * pow(3, N - i - 2, MOD) * 2
    ans %= MOD
ans += accA[-1]
ans %= MOD
print(ans)
0