結果

問題 No.1681 +-*
ユーザー irumo8202irumo8202
提出日時 2022-01-27 11:00:51
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 207 ms / 2,000 ms
コード長 242 bytes
コンパイル時間 1,416 ms
コンパイル使用メモリ 86,744 KB
実行使用メモリ 105,536 KB
最終ジャッジ日時 2023-08-26 05:08:21
合計ジャッジ時間 4,895 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,056 KB
testcase_01 AC 71 ms
71,248 KB
testcase_02 AC 73 ms
71,444 KB
testcase_03 AC 73 ms
71,148 KB
testcase_04 AC 74 ms
71,044 KB
testcase_05 AC 193 ms
104,996 KB
testcase_06 AC 193 ms
105,536 KB
testcase_07 AC 192 ms
105,508 KB
testcase_08 AC 206 ms
100,440 KB
testcase_09 AC 206 ms
100,548 KB
testcase_10 AC 206 ms
100,432 KB
testcase_11 AC 207 ms
100,560 KB
testcase_12 AC 206 ms
100,552 KB
testcase_13 AC 135 ms
91,508 KB
testcase_14 AC 205 ms
100,320 KB
testcase_15 AC 71 ms
71,152 KB
testcase_16 AC 71 ms
71,112 KB
testcase_17 AC 205 ms
100,548 KB
testcase_18 AC 205 ms
100,328 KB
testcase_19 AC 207 ms
100,276 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

ans = 0
tot = 1

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