首先是数据 https://www.luogu.com.cn/paste/4m2g4x44。
感谢 @wangxiaorui_IAKIOI。
其次,被叉的题解,大多是模数写错。
https://www.luogu.com.cn/blog/user9671/solution-p1879
https://www.luogu.com.cn/blog/101-2365-191/solution-p1879 的第二份代码
https://www.luogu.com.cn/blog/liu930587501/solution-p1879
https://www.luogu.com.cn/blog/1515016842abc/solution-p1879
https://www.luogu.com.cn/blog/doushen/solution-1879
https://www.luogu.com.cn/blog/jdoiFSW/solution-p1879
https://www.luogu.com.cn/blog/lxzsyingyingying/solution-p1879
https://www.luogu.com.cn/blog/ShadowassIIXVIIIIV/solution-p1879
https://www.luogu.com.cn/blog/user33084/solution-p1879