Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
37798 daimo 【S】T1 C++ 解答错误 10 1000 MS 284 KB 707 2025-05-11 13:59:47

Tests(1/10):


#include<bits/stdc++.h> 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(int c){ if(c==0)return 1; if(c==1)return 2%mod; int a=quick(c/2),b=quick(1); if(c%2==0)return (a*a)%mod; else return (((a*a)%mod)*b)%mod; } signed main(){ fastios(); //testread(); //realread(); int t; cin>>t; while(t--){ int n; cin>>n; cout<<(quick(n)-n%mod+mod-1)%mod<<endl; } return 0; }


测评信息: