結果

問題 No.1102 Remnants
ユーザー NoneNone
提出日時 2021-03-04 16:45:35
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 275 ms / 2,000 ms
コード長 279 bytes
コンパイル時間 1,126 ms
コンパイル使用メモリ 82,120 KB
実行使用メモリ 112,932 KB
最終ジャッジ日時 2024-04-15 09:08:43
合計ジャッジ時間 4,974 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
52,024 KB
testcase_01 AC 45 ms
51,820 KB
testcase_02 AC 40 ms
52,088 KB
testcase_03 AC 41 ms
52,604 KB
testcase_04 AC 40 ms
52,188 KB
testcase_05 AC 211 ms
107,852 KB
testcase_06 AC 77 ms
69,096 KB
testcase_07 AC 275 ms
112,932 KB
testcase_08 AC 52 ms
63,028 KB
testcase_09 AC 56 ms
64,784 KB
testcase_10 AC 50 ms
62,592 KB
testcase_11 AC 55 ms
63,444 KB
testcase_12 AC 58 ms
66,128 KB
testcase_13 AC 58 ms
64,200 KB
testcase_14 AC 139 ms
86,516 KB
testcase_15 AC 118 ms
82,348 KB
testcase_16 AC 237 ms
109,744 KB
testcase_17 AC 237 ms
101,268 KB
testcase_18 AC 243 ms
102,704 KB
testcase_19 AC 119 ms
86,700 KB
testcase_20 AC 69 ms
68,948 KB
testcase_21 AC 164 ms
92,716 KB
testcase_22 AC 214 ms
99,372 KB
testcase_23 AC 174 ms
92,532 KB
testcase_24 AC 143 ms
88,592 KB
testcase_25 AC 241 ms
102,360 KB
testcase_26 AC 60 ms
65,512 KB
testcase_27 AC 99 ms
80,372 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

MOD = 10**9+7
N,K=map(int, input().split())
A=list(map(int, input().split()))

f=[1]
for i in range(1,N+1):
    f.append(f[-1]*(K+i)*pow(i,MOD-2,MOD)%MOD)

res=0
for i in range(N):
    res+=A[i]*f[i]%MOD*f[N-1-i]%MOD
    res%=MOD
print(res)
0