标签:res mes lld using nbsp pre scanf main type
#include<bits/stdc++.h> #define MAX 100005 #define mod 1000000007 using namespace std; typedef long long ll; char st[MAX]; int main() { int t; scanf("%d",&t); while(t--) { ll p=0; int i=0,j; scanf("%s",st); while(st[i]!=‘\0‘) { p*=10; p+=(st[i++]-‘0‘); p%=(mod-1); } p=p-1; ll res=2,ans=1; while(p) { if(p&1) ans=ans*res%mod; res=res*res%mod; p>>=1; } printf("%lld\n",ans); } return 0; }
标签:res mes lld using nbsp pre scanf main type
原文地址:https://www.cnblogs.com/kannyi/p/9655583.html