第一题暴力(注意mod),第二题拓扑博弈(反向建边,https://nuoyanli.blog.csdn.net/article/details/120037476