zhxs contest (hdu 5187 快速幂+快速乘法) Home » 编程开发 » zhxs contest (hdu 5187 快速幂+快速乘法) Hint In the first case, both sequence {1, 2} and {2, 1} are legal.In the second case, sequence {1, 2, 3}, {1, 3, 2}, {2, 1, 3}, {2, 3, 1}, {3, 1, 2}, {3, 2, 1} are legal, so the answer is 6 mod 5 = 1 ,友谊之花、爱情之树、以及遗憾之泪!