如果你爆0了,可能有一下错误:
poww(...., 1ll*n/l*m/l%(mod-1)) 应该改为 poww(...., 1ll *(n/l) *(m/l) %(mod-1)) 如果你次幂 对 mod 取模也会挂,根据费马小定理,应该对 (mod-1) 取模才是正确的。