提交时间:2025-05-11 14:05:11

运行 ID: 37807

#include <bits/stdc++.h> #define int long long using namespace std; const int mod = 1e9 + 7; int t,n; inline int pw (int x,int y) { int r = 1; while (y) { if (y & 1) { r = r * x % mod; } x = x * x % mod; y >>= 1; } return r; } signed main () { cin >> t; while (t--) { cin >> n; int ans = pw(2,n); ans = (ans - 1 - n) % mod; ans = (ans + mod) % mod; cout << ans << endl; } return 0; }