#include <iostream>
#include<cstdio>
#include<cstring>
using namespace std;
const int MOD=1e9+7;
void solve(int n)
{
long long ans=1;
long long a=2;
while(n)
{
if(n&1)
{
ans=(ans%MOD*(a%MOD))%MOD;
}
a=(a%MOD*(a%MOD))%MOD;
n>>=1;
}
cout<<ans<<endl;
}
int main()
{
int n,t;
while(~scanf("%d",&t))
{
while(t--)
{
scanf("%d",&n);
solve(n);
}
}
return 0;
}
快次幂
最新推荐文章于 2022-03-19 13:21:14 发布