結果

問題 No.1681 +-*
ユーザー Eki1009Eki1009
提出日時 2021-09-18 00:24:03
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 140 ms / 2,000 ms
コード長 213 bytes
コンパイル時間 295 ms
コンパイル使用メモリ 87,184 KB
実行使用メモリ 125,648 KB
最終ジャッジ日時 2023-09-12 10:44:38
合計ジャッジ時間 3,854 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,276 KB
testcase_01 AC 74 ms
71,420 KB
testcase_02 AC 76 ms
71,584 KB
testcase_03 AC 76 ms
71,380 KB
testcase_04 AC 74 ms
71,604 KB
testcase_05 AC 134 ms
125,220 KB
testcase_06 AC 133 ms
125,260 KB
testcase_07 AC 132 ms
125,648 KB
testcase_08 AC 140 ms
116,120 KB
testcase_09 AC 139 ms
116,200 KB
testcase_10 AC 138 ms
116,556 KB
testcase_11 AC 139 ms
116,224 KB
testcase_12 AC 140 ms
116,324 KB
testcase_13 AC 109 ms
101,392 KB
testcase_14 AC 138 ms
116,208 KB
testcase_15 AC 74 ms
71,276 KB
testcase_16 AC 74 ms
71,520 KB
testcase_17 AC 136 ms
116,356 KB
testcase_18 AC 140 ms
116,396 KB
testcase_19 AC 139 ms
116,500 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 10**9+7
n, *A = map(int, open(0).read().split())
ans = 0
t = 1
L = [1, 2]
for _ in range(n-2):
    L.append(L[-1] * 3 % mod)
for i in range(n):
    t = t*A[i]%mod
    ans += t*L[~i]
    ans %= mod
print(ans)
0