ZYCode R6 Spasmodic 题解

· · 个人记录

考虑将题目转化一下,令 a_i'=a_i+(n-i)(k-1),求满足 l+(n-1)(k-1)\le a_1'<a_2'<...<a_n'\le r 的序列 a' 的个数。使用 Lucas 定理求组合数即可。

lucas 定理