关于费马小定理:https://www.cnblogs.com/rstz/p/12359948.html
1 #include <iostream> 2 #define mod 1000000007 3 using namespace std; 4 5 long long ksm(long long a, long long n){ 6 long long ans = 1; 7 while(n){ 8 if(n&1)ans = ans*a % mod; 9 a = a * a %mod; 10 n >>= 1; 11 } 12 return ans; 13 } 14 int main(){ 15 cout << ksm(20191031, mod - 2) << endl; 16 }