标签:font case http field void image mod lld tle
Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Others)
Total Submission(s): 953 Accepted Submission(s): 418
1 #include<bits/stdc++.h> 2 using namespace std; 3 #define LL long long 4 const LL mod=1e9+7; 5 LL inv[1000005]={1,1}; 6 LL cat[1000005]={1,1,1}; 7 void init() 8 { 9 for(int i=2;i<=1000000;++i) 10 inv[i]=(mod-mod/i)*inv[mod%i]%mod; 11 for(int i=3;i<=1000001;++i) 12 cat[i]=cat[i-1]*((4+10*mod-6*inv[i-1])%mod)%mod; 13 } 14 int main() 15 { 16 int t,k=0,i,n; 17 scanf("%d",&t); 18 init(); 19 for(i=1;i<=t;++i){ 20 scanf("%d",&n); 21 printf("Case #%d:\n%lld\n",i,cat[n+2]); 22 } 23 return 0; 24 }
标签:font case http field void image mod lld tle
原文地址:http://www.cnblogs.com/zzqc/p/7243689.html