結果
| 問題 | No.3391 Line up Dominoes |
| コンテスト | |
| ユーザー |
timi
|
| 提出日時 | 2025-11-28 22:46:01 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 373 bytes |
| コンパイル時間 | 456 ms |
| コンパイル使用メモリ | 82,296 KB |
| 実行使用メモリ | 241,848 KB |
| 最終ジャッジ日時 | 2025-11-28 22:47:37 |
| 合計ジャッジ時間 | 76,945 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | TLE * 22 MLE * 1 |
ソースコード
N,M,K=map(int, input().split())
A=list(map(int, input().split()))
A=sorted(A)
mod=998244353
import bisect
B=[]
for a in A:
l=bisect.bisect_left(A,a-K)
r=bisect.bisect_left(A,a+K+1)
B.append((l,r))
dp=[1]*N
for i in range(M-1):
C=[0]
for d in dp:
C.append((C[-1]+d)%mod)
ndp=[]
for l,r in B:
ndp.append((C[r]-C[l])%mod)
dp=ndp
print(sum(dp)%mod)
timi