1.000s
128MB
a^b mod p=s
2 10 9
2^10 mod 9=7
样例解释
lns="http://www.w3.org/1998/Math/MathML">2^{10} = 1024210=1024,lns="http://www.w3.org/1998/Math/MathML">1024 \bmod 9 = 71024mod9=7。
数据规模与约定
对于 lns="http://www.w3.org/1998/Math/MathML">100\%100% 的数据,保证 lns="http://www.w3.org/1998/Math/MathML">0\le a,b < 2^{31}0≤a,b<231,lns="http://www.w3.org/1998/Math/MathML">a+b>0a+b>0,lns="http://www.w3.org/1998/Math/MathML">2 \leq p \lt 2^{31}2≤p<231