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