Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
37800 | daimo | 【S】T1 | C++ | 通过 | 100 | 641 MS | 276 KB | 679 | 2025-05-11 14:02:07 |
#include<bits/stdc++.h> #define int long long using namespace std; const int mod=1e9+7; void testread(){freopen("test.in","r",stdin);freopen("test.out","w",stdout);} void fastios(){ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);} void realread(){freopen("future.in","r",stdin);freopen("future.out","w",stdout);} int quickpow(int a,int b) { int res=1; while(b) { if(b&1)res=res*a%mod; a=a*a%mod; b>>=1; } return res; } signed main(){ fastios(); //testread(); //realread(); int t; cin>>t; while(t--){ int n; cin>>n; cout<<(quickpow(2,n)-n%mod+mod*100000000-1)%mod<<endl; } return 0; }