Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
37804 | 沈仲恩 | 【S】T1 | C++ | 通过 | 100 | 46 MS | 248 KB | 506 | 2025-05-11 14:03:40 |
#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 */