結果

問題 No.1102 Remnants
ユーザー tyawanmusityawanmusi
提出日時 2020-07-03 21:52:52
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 974 ms / 2,000 ms
コード長 238 bytes
コンパイル時間 97 ms
コンパイル使用メモリ 11,924 KB
実行使用メモリ 31,864 KB
最終ジャッジ日時 2023-10-17 01:47:46
合計ジャッジ時間 11,287 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,120 KB
testcase_01 AC 30 ms
10,120 KB
testcase_02 AC 28 ms
10,120 KB
testcase_03 AC 29 ms
10,120 KB
testcase_04 AC 29 ms
10,120 KB
testcase_05 AC 767 ms
27,544 KB
testcase_06 AC 150 ms
13,016 KB
testcase_07 AC 974 ms
31,864 KB
testcase_08 AC 42 ms
10,420 KB
testcase_09 AC 68 ms
10,936 KB
testcase_10 AC 34 ms
10,232 KB
testcase_11 AC 56 ms
10,696 KB
testcase_12 AC 72 ms
11,056 KB
testcase_13 AC 68 ms
10,988 KB
testcase_14 AC 437 ms
19,928 KB
testcase_15 AC 353 ms
17,000 KB
testcase_16 AC 889 ms
29,924 KB
testcase_17 AC 836 ms
26,448 KB
testcase_18 AC 853 ms
28,920 KB
testcase_19 AC 302 ms
16,472 KB
testcase_20 AC 110 ms
12,120 KB
testcase_21 AC 517 ms
21,396 KB
testcase_22 AC 734 ms
26,056 KB
testcase_23 AC 560 ms
22,332 KB
testcase_24 AC 406 ms
19,068 KB
testcase_25 AC 859 ms
29,416 KB
testcase_26 AC 76 ms
11,168 KB
testcase_27 AC 243 ms
14,896 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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