結果

問題 No.1102 Remnants
ユーザー Navier_BoltzmannNavier_Boltzmann
提出日時 2023-11-17 23:12:07
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 314 ms / 2,000 ms
コード長 420 bytes
コンパイル時間 306 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 125,324 KB
最終ジャッジ日時 2023-11-17 23:12:15
合計ジャッジ時間 7,210 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 48 ms
55,596 KB
testcase_01 AC 45 ms
55,596 KB
testcase_02 AC 44 ms
55,596 KB
testcase_03 AC 45 ms
55,596 KB
testcase_04 AC 43 ms
55,596 KB
testcase_05 AC 228 ms
104,484 KB
testcase_06 AC 80 ms
75,608 KB
testcase_07 AC 314 ms
125,324 KB
testcase_08 AC 56 ms
66,664 KB
testcase_09 AC 61 ms
68,848 KB
testcase_10 AC 55 ms
66,672 KB
testcase_11 AC 61 ms
70,808 KB
testcase_12 AC 65 ms
73,140 KB
testcase_13 AC 61 ms
68,968 KB
testcase_14 AC 151 ms
98,780 KB
testcase_15 AC 126 ms
91,576 KB
testcase_16 AC 254 ms
106,520 KB
testcase_17 AC 273 ms
107,140 KB
testcase_18 AC 282 ms
122,052 KB
testcase_19 AC 155 ms
86,384 KB
testcase_20 AC 79 ms
78,604 KB
testcase_21 AC 188 ms
95,580 KB
testcase_22 AC 244 ms
103,376 KB
testcase_23 AC 198 ms
95,788 KB
testcase_24 AC 154 ms
89,384 KB
testcase_25 AC 308 ms
122,140 KB
testcase_26 AC 66 ms
73,304 KB
testcase_27 AC 115 ms
86,288 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import *
from itertools import *
from functools import *
from heapq import *
import sys,math
input = sys.stdin.readline

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

C = defaultdict(int)
C[K] = 1
for i in range(N):
    C[i+1+K] = C[i+K]*(i+1+K)*pow(i+1,mod-2,mod)%mod


ans = 0
for i,a in enumerate(A):
    
    ans += C[i+K]*C[N-i+K-1]*a
    ans %= mod
print(ans)
0