Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
37793 | daimo | 【S】T1 | C++ | 运行超时 | 10 | 1000 MS | 73492 KB | 788 | 2025-05-11 13:53:38 |
#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);} map<int,int>mp; int quick_pow(int x){ if(mp[x])return mp[x]; if(x==0){mp[x]=1;return 1;} if(x%2==1){mp[x]=(((quick_pow(x/2)*quick_pow(x/2))%mod)*2)%mod;return mp[x];} else{mp[x]=((quick_pow(x/2)*quick_pow(x/2))%mod);return mp[x];} } signed main(){ fastios(); //testread(); //realread(); int t; cin>>t; while(t--){ int n; cin>>n; cout<<(quick_pow(n)-n-1)%mod<<endl; } return 0; }