結果

問題 No.1681 +-*
ユーザー first_vilfirst_vil
提出日時 2021-11-18 16:57:20
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 208 bytes
コンパイル時間 78 ms
コンパイル使用メモリ 10,776 KB
実行使用メモリ 34,252 KB
最終ジャッジ日時 2023-08-27 04:07:58
合計ジャッジ時間 6,820 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
14,964 KB
testcase_01 AC 17 ms
7,760 KB
testcase_02 AC 17 ms
7,840 KB
testcase_03 AC 18 ms
7,872 KB
testcase_04 AC 19 ms
7,784 KB
testcase_05 AC 495 ms
29,852 KB
testcase_06 AC 497 ms
29,784 KB
testcase_07 AC 500 ms
29,024 KB
testcase_08 TLE -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = int(1e9+7)
n = int(input())
mul = 1
ans = 0
for i,a in enumerate(list(map(int,input().split()))):
	mul *= a
	if i == n-1:
		ans += mul
	else:
		ans += mul * 2 * pow(3,n-2-i,mod) 
	ans %= mod
print(ans)
0