//a的b次方Mod c //参数为整数 //使用时注意修改类型 typedef long PowerMulType; PowerMulType PowerMul(PowerMulType a,PowerMulType b,PowerMulType c) { PowerMulType tmpInt = 1; while (b) { if (b & 1) tmpInt = (tmpInt * a) % c; a = (a * a) % c; b >>= 1; } return tmpInt; }