final static long DIV = 1000000009; //分治法, 注意java类型为long, C++为__int64或 long long public static long longPow(long x, long n) { long ans; if(n == 0) return 1; if(n%2 == 1) { ans = longPow(x, n-1)*x; return ans%DIV; } else { ans = longPow(x, n/2); return (ans*ans)%DIV; } }