提交时间:2025-05-11 12:50:04

运行 ID: 37779

#include<bits/stdc++.h> using namespace std; #define int long long int read(){int x=0,f=1;char c=getchar();while(c>'9'||c<'0'){if(c=='-')f=-1;c=getchar();}while(c>='0'&&c<='9')x=x*10+c-'0',c=getchar();return x*f;} const int MAXN=100010,Mod=1e9+7; int Pow(int x,int y){int rt=1;while(y){if(y&1)rt=rt*x%Mod;x=x*x%Mod;y>>=1;}return rt;} void add(int &x,int y){x+=y;if(x>=Mod)x-=Mod;if(x<0)x+=Mod;} int n,m,ans; void slv(){ n=read(); printf("%lld\n",((Pow(2,n)-n-1)%Mod+Mod)%Mod); } signed main(){ // freopen("future.in","r",stdin);freopen("future.out","w",stdout); int _=read();while(_--) slv(); return 0; }