結果

問題 No.1681 +-*
ユーザー とりゐとりゐ
提出日時 2021-09-17 21:28:03
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 216 ms / 2,000 ms
コード長 186 bytes
コンパイル時間 772 ms
コンパイル使用メモリ 87,172 KB
実行使用メモリ 105,816 KB
最終ジャッジ日時 2023-09-12 06:51:41
合計ジャッジ時間 5,045 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,188 KB
testcase_01 AC 73 ms
71,344 KB
testcase_02 AC 77 ms
71,500 KB
testcase_03 AC 76 ms
71,328 KB
testcase_04 AC 75 ms
71,520 KB
testcase_05 AC 198 ms
105,816 KB
testcase_06 AC 198 ms
105,712 KB
testcase_07 AC 197 ms
105,740 KB
testcase_08 AC 216 ms
100,660 KB
testcase_09 AC 216 ms
100,472 KB
testcase_10 AC 214 ms
100,400 KB
testcase_11 AC 215 ms
100,712 KB
testcase_12 AC 214 ms
100,656 KB
testcase_13 AC 138 ms
91,480 KB
testcase_14 AC 213 ms
100,500 KB
testcase_15 AC 73 ms
71,576 KB
testcase_16 AC 73 ms
71,536 KB
testcase_17 AC 213 ms
100,648 KB
testcase_18 AC 212 ms
100,472 KB
testcase_19 AC 213 ms
100,576 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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