結果

問題 No.1681 +-*
ユーザー first_vilfirst_vil
提出日時 2021-11-18 16:59:46
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 216 ms / 2,000 ms
コード長 221 bytes
コンパイル時間 488 ms
コンパイル使用メモリ 87,084 KB
実行使用メモリ 105,944 KB
最終ジャッジ日時 2023-08-27 04:12:05
合計ジャッジ時間 5,115 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,336 KB
testcase_01 AC 74 ms
71,100 KB
testcase_02 AC 75 ms
71,356 KB
testcase_03 AC 74 ms
71,236 KB
testcase_04 AC 76 ms
71,216 KB
testcase_05 AC 198 ms
105,608 KB
testcase_06 AC 199 ms
105,912 KB
testcase_07 AC 199 ms
105,944 KB
testcase_08 AC 214 ms
100,572 KB
testcase_09 AC 212 ms
100,548 KB
testcase_10 AC 216 ms
100,708 KB
testcase_11 AC 216 ms
100,604 KB
testcase_12 AC 215 ms
100,664 KB
testcase_13 AC 140 ms
91,312 KB
testcase_14 AC 212 ms
100,580 KB
testcase_15 AC 73 ms
71,296 KB
testcase_16 AC 72 ms
71,236 KB
testcase_17 AC 209 ms
100,556 KB
testcase_18 AC 214 ms
100,500 KB
testcase_19 AC 216 ms
100,476 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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