結果

問題 No.1102 Remnants
ユーザー takakintakakin
提出日時 2020-07-06 22:22:50
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 944 ms / 2,000 ms
コード長 293 bytes
コンパイル時間 184 ms
コンパイル使用メモリ 12,000 KB
実行使用メモリ 31,824 KB
最終ジャッジ日時 2023-10-24 23:28:54
合計ジャッジ時間 10,731 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,072 KB
testcase_01 AC 30 ms
10,072 KB
testcase_02 AC 29 ms
10,072 KB
testcase_03 AC 29 ms
10,072 KB
testcase_04 AC 29 ms
10,072 KB
testcase_05 AC 757 ms
27,500 KB
testcase_06 AC 146 ms
12,976 KB
testcase_07 AC 944 ms
31,824 KB
testcase_08 AC 42 ms
10,376 KB
testcase_09 AC 66 ms
10,892 KB
testcase_10 AC 33 ms
10,184 KB
testcase_11 AC 56 ms
10,636 KB
testcase_12 AC 71 ms
10,988 KB
testcase_13 AC 68 ms
10,940 KB
testcase_14 AC 423 ms
19,884 KB
testcase_15 AC 345 ms
16,956 KB
testcase_16 AC 861 ms
29,880 KB
testcase_17 AC 819 ms
26,404 KB
testcase_18 AC 825 ms
28,880 KB
testcase_19 AC 296 ms
16,428 KB
testcase_20 AC 108 ms
12,116 KB
testcase_21 AC 502 ms
21,352 KB
testcase_22 AC 703 ms
26,012 KB
testcase_23 AC 546 ms
22,292 KB
testcase_24 AC 397 ms
19,024 KB
testcase_25 AC 835 ms
29,372 KB
testcase_26 AC 75 ms
11,116 KB
testcase_27 AC 241 ms
14,852 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=lambda: sys.stdin.readline().rstrip()
n,k=map(int,input().split())
A=[int(i) for i in input().split()]
mod=10**9+7

H=[0]*(n+1)
H[0]=1
for i in range(n):
  H[i+1]=(H[i]*(k+i+1)*pow(i+1,mod-2,mod))%mod
ans=0
for i,a in enumerate(A):
  ans=(ans+a*(H[i]*H[n-i-1]))%mod
print(ans)
0