結果

問題 No.1102 Remnants
ユーザー anagohirameanagohirame
提出日時 2020-07-04 00:12:20
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 285 ms / 2,000 ms
コード長 302 bytes
コンパイル時間 382 ms
コンパイル使用メモリ 81,728 KB
実行使用メモリ 112,728 KB
最終ジャッジ日時 2023-10-17 06:36:34
合計ジャッジ時間 5,375 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,468 KB
testcase_01 AC 38 ms
53,468 KB
testcase_02 AC 39 ms
53,468 KB
testcase_03 AC 38 ms
53,468 KB
testcase_04 AC 38 ms
53,468 KB
testcase_05 AC 193 ms
99,320 KB
testcase_06 AC 71 ms
68,896 KB
testcase_07 AC 285 ms
112,728 KB
testcase_08 AC 50 ms
62,316 KB
testcase_09 AC 55 ms
64,364 KB
testcase_10 AC 49 ms
62,320 KB
testcase_11 AC 56 ms
66,428 KB
testcase_12 AC 60 ms
68,476 KB
testcase_13 AC 56 ms
64,364 KB
testcase_14 AC 129 ms
81,228 KB
testcase_15 AC 111 ms
77,940 KB
testcase_16 AC 232 ms
105,068 KB
testcase_17 AC 247 ms
106,096 KB
testcase_18 AC 254 ms
102,936 KB
testcase_19 AC 122 ms
84,400 KB
testcase_20 AC 67 ms
73,448 KB
testcase_21 AC 170 ms
94,740 KB
testcase_22 AC 221 ms
103,828 KB
testcase_23 AC 183 ms
95,180 KB
testcase_24 AC 147 ms
90,728 KB
testcase_25 AC 254 ms
102,992 KB
testcase_26 AC 59 ms
68,464 KB
testcase_27 AC 106 ms
82,816 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 10**9 + 7
n, k = map(int, input().split())
comb = [1 for _ in range(n+1)]
for i in range(1, n):
	comb[i] = comb[i-1] * (k+i) * pow(i, MOD-2, MOD)
	comb[i] %= MOD

a = list(map(int, input().split()))
ans = 0
for i, x in enumerate(a):
	j = n-i-1
	ans += comb[i] * comb[j] * x
	ans %= MOD
print(ans)
0