結果

問題 No.1681 +-*
ユーザー pluto77pluto77
提出日時 2022-02-08 11:06:57
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 566 ms / 2,000 ms
コード長 193 bytes
コンパイル時間 869 ms
コンパイル使用メモリ 10,652 KB
実行使用メモリ 30,004 KB
最終ジャッジ日時 2023-09-05 08:12:56
合計ジャッジ時間 10,544 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,856 KB
testcase_01 AC 16 ms
7,936 KB
testcase_02 AC 18 ms
7,764 KB
testcase_03 AC 18 ms
7,824 KB
testcase_04 AC 18 ms
7,904 KB
testcase_05 AC 514 ms
29,692 KB
testcase_06 AC 532 ms
29,728 KB
testcase_07 AC 533 ms
29,808 KB
testcase_08 AC 566 ms
29,876 KB
testcase_09 AC 562 ms
30,004 KB
testcase_10 AC 564 ms
29,968 KB
testcase_11 AC 554 ms
29,988 KB
testcase_12 AC 557 ms
29,940 KB
testcase_13 AC 261 ms
18,940 KB
testcase_14 AC 514 ms
29,988 KB
testcase_15 AC 16 ms
7,860 KB
testcase_16 AC 15 ms
7,836 KB
testcase_17 AC 553 ms
29,804 KB
testcase_18 AC 543 ms
29,804 KB
testcase_19 AC 560 ms
29,832 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#yuki1681
mod=10**9+7
n=int(input())
a=list(map(int,input().split()))
res=0
d=1
for i in range(n):
 d*=a[i]
 d%=mod
 if i!=n-1:
  res+=d*2*pow(3,n-2-i,mod)
 else:
  res+=d
 res%=mod
print(res)
0