結果

問題 No.1681 +-*
ユーザー syunsuke1024syunsuke1024
提出日時 2021-09-19 15:01:29
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 213 ms / 2,000 ms
コード長 229 bytes
コンパイル時間 282 ms
コンパイル使用メモリ 87,148 KB
実行使用メモリ 105,852 KB
最終ジャッジ日時 2023-09-14 10:41:24
合計ジャッジ時間 5,748 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,376 KB
testcase_01 AC 77 ms
71,344 KB
testcase_02 AC 74 ms
71,320 KB
testcase_03 AC 73 ms
71,348 KB
testcase_04 AC 74 ms
71,408 KB
testcase_05 AC 198 ms
105,732 KB
testcase_06 AC 194 ms
105,852 KB
testcase_07 AC 194 ms
105,744 KB
testcase_08 AC 212 ms
100,520 KB
testcase_09 AC 212 ms
100,684 KB
testcase_10 AC 213 ms
100,620 KB
testcase_11 AC 213 ms
100,616 KB
testcase_12 AC 210 ms
100,308 KB
testcase_13 AC 136 ms
91,420 KB
testcase_14 AC 209 ms
100,308 KB
testcase_15 AC 72 ms
71,616 KB
testcase_16 AC 74 ms
71,612 KB
testcase_17 AC 211 ms
100,344 KB
testcase_18 AC 210 ms
100,488 KB
testcase_19 AC 212 ms
100,296 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
L = list(map(int,input().split()))

ans = 0
mod = 10**9 + 7
now = L[0]
for i in range(N-1):
    ans += now * 2 * pow(3,N-2-i,mod)
    ans %= mod
    now *= L[i+1]
    now %= mod
#print(ans)
print((ans + now)%mod)
0