提交时间:2025-05-11 14:03:40
运行 ID: 37804
#include <bits/stdc++.h> #define int long long using namespace std; int _; const int mod = 1e9 + 7; inline int qp(int x, int y) { int res = 1; while (y) { if (y & 1) res = res * x % mod; x = x * x % mod, y >>= 1; } return res; } signed main() { scanf("%lld", &_); while (_--) { int n; scanf("%lld", &n); printf("%lld\n", (qp(2, n) - n % mod - 1 + mod) % mod); } return 0; } /* 24135 */