Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
37809 | 申东铉 | 【S】T1 | C++ | 运行超时 | 10 | 1000 MS | 248 KB | 542 | 2025-05-11 14:07:12 |
#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) { y %= mod - 1; 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; }