結果
問題 | No.1102 Remnants |
ユーザー |
![]() |
提出日時 | 2020-07-03 21:50:12 |
言語 | PyPy3 (7.3.15) |
結果 |
MLE
|
実行時間 | - |
コード長 | 303 bytes |
コンパイル時間 | 190 ms |
コンパイル使用メモリ | 81,808 KB |
実行使用メモリ | 848,544 KB |
最終ジャッジ日時 | 2023-10-17 00:38:22 |
合計ジャッジ時間 | 3,409 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge13 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 34 ms
53,548 KB |
testcase_01 | AC | 34 ms
53,548 KB |
testcase_02 | MLE | - |
testcase_03 | -- | - |
testcase_04 | -- | - |
testcase_05 | -- | - |
testcase_06 | -- | - |
testcase_07 | -- | - |
testcase_08 | -- | - |
testcase_09 | -- | - |
testcase_10 | -- | - |
testcase_11 | -- | - |
testcase_12 | -- | - |
testcase_13 | -- | - |
testcase_14 | -- | - |
testcase_15 | -- | - |
testcase_16 | -- | - |
testcase_17 | -- | - |
testcase_18 | -- | - |
testcase_19 | -- | - |
testcase_20 | -- | - |
testcase_21 | -- | - |
testcase_22 | -- | - |
testcase_23 | -- | - |
testcase_24 | -- | - |
testcase_25 | -- | - |
testcase_26 | -- | - |
testcase_27 | -- | - |
ソースコード
n,k=map(int,input().split()) a=list(map(int,input().split())) mod=10**9+7 f=[1] for i in range(n+k):f+=[f[-1]*(i+1)%mod] def comb(a,b):return f[a]*pow(f[b],mod-2,mod)*pow(f[a-b],mod-2,mod)%mod ans=0 for i in range(n): x=(i+1) y=(n-i) ans+=comb(x+k-1,x-1)*comb(y+k-1,y-1)*a[i] ans%=mod print(ans)