2015
09-17

# Sum

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)
Total Submission(s): 589    Accepted Submission(s): 292

Problem Description

Sample Input
2

Sample Output
2
Hint
1.  For N = 2, S(1) = S(2) = 1.

2.  The input file consists of multiple test cases.


/*分析:题目要求s1+s2+s3+...+sn;//si表示n划分i个数的n的划分的个数,如n=4,则s1=1,s2=3

=>A(n+1)=A0+A1+A2+A3+...+An =>An=2^(n-1);

*/
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<string>
#include<queue>
#include<algorithm>
#include<map>
#include<iomanip>
#define INF 99999999
using namespace std;

const int MAX=100000+10;
const int mod=1000000000+7;
char s[MAX];

__int64 MOD(char *a,int Mod){
__int64 sum=0;
for(int i=0;a[i] != '\0';++i){
sum=(sum*10+a[i]-'0')%Mod;
}
return sum;
}

__int64 FastPow(__int64 a,__int64 k){
k=(k+mod)%mod;
__int64 sum=1;
while(k){
if(k&1)sum=sum*a%mod;
a=a*a%mod;
k>>=1;
}
return sum;
}

int main(){
while(scanf("%s",s)!=EOF){
__int64 n=MOD(s,mod-1)-1;
printf("%I64d\n",FastPow(2,n));
}
return 0;
}

1. 高仿奢侈品ଜFUTURE SHIES(未来天空)Chloé(克洛伊)qi ya shi(娸雅诗)Tom Ford(汤姆●福特)Sophie hume(索菲休栂)BALLY(巴利)Calvin Klein(CK)yuandan.ga