Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
37799 申东铉 【S】T1 C++ 运行超时 10 1000 MS 248 KB 520 2025-05-11 14:02:03

Tests(1/10):


#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 + mod) % mod; cout << ans << endl; } return 0; }


测评信息: