Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
37796 申东铉 【S】T1 C++ 运行超时 10 1000 MS 260 KB 515 2025-05-11 13:59:34

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) { 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 % (mod - 1)); ans = (ans - 1 - n % mod + mod) % mod; cout << ans << endl; } return 0; }


测评信息: