Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
37791 | A21μΘ_wjy | 【S】T1 | C++ | 通过 | 100 | 41 MS | 272 KB | 450 | 2025-05-11 13:50:52 |
#include<bits/stdc++.h> #define int long long #define endl '\n' using namespace std; const int mod=1e9+7; int n; inline int qpow(int a,int b){ int Ans=1; while(b){ if(b&1)Ans=Ans*a%mod; a=a*a%mod;b>>=1; }return Ans; } signed main(){ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); int T; cin>>T; while(T--){ cin>>n; cout<<(qpow(2,n)-(1+n)%mod+mod)%mod<<endl; }return 0; }