結果

問題 No.1681 +-*
ユーザー 👑 H20H20
提出日時 2021-12-20 17:56:46
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 210 ms / 2,000 ms
コード長 204 bytes
コンパイル時間 534 ms
コンパイル使用メモリ 86,832 KB
実行使用メモリ 105,660 KB
最終ジャッジ日時 2023-10-13 19:33:13
合計ジャッジ時間 6,153 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
71,324 KB
testcase_01 AC 74 ms
71,256 KB
testcase_02 AC 75 ms
71,168 KB
testcase_03 AC 76 ms
71,028 KB
testcase_04 AC 75 ms
71,000 KB
testcase_05 AC 196 ms
105,524 KB
testcase_06 AC 193 ms
105,660 KB
testcase_07 AC 193 ms
105,660 KB
testcase_08 AC 209 ms
100,332 KB
testcase_09 AC 208 ms
100,492 KB
testcase_10 AC 207 ms
100,400 KB
testcase_11 AC 204 ms
100,176 KB
testcase_12 AC 206 ms
100,336 KB
testcase_13 AC 134 ms
91,328 KB
testcase_14 AC 210 ms
100,560 KB
testcase_15 AC 72 ms
71,160 KB
testcase_16 AC 72 ms
71,160 KB
testcase_17 AC 210 ms
100,464 KB
testcase_18 AC 206 ms
100,280 KB
testcase_19 AC 208 ms
100,308 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N= int(input())
A = list(map(int,input().split()))
mod = 10**9+7
mul = 1
ans = 0
for i in range(N-1):
    mul=mul*A[i]%mod
    ans = (ans+mul*pow(3,N-i-2,mod)*2)%mod
ans = (ans + mul*A[-1])%mod
print(ans)
0