标签:href turn clu pow ref back ack style define
///@author Sycamore, ZJNU; ///@date 8/4/2017 #include<bits/stdc++.h> using namespace std; #define endl ‘\n‘ typedef long long ll; const ll _mod = 1000000007; ll mod(ll a, ll b) { return ((a%b) + b) % b; } ll powermod(ll a, ll b, ll m) { ll ret = 1; while (b) { if (b & 1) ret = mod(ret*a, m); a = mod(a*a, m); b >>= 1; } return ret; } int main() { cin.tie(NULL); int t, n; cin >> t; while (t--) { scanf("%d", &n); ll ans = powermod(2, n - 1, _mod); ans = mod(ans - 1, _mod); cout << ans << endl; } return 0; }
标签:href turn clu pow ref back ack style define
原文地址:http://www.cnblogs.com/zjnu/p/7295083.html