Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
两者相等的情况没有考虑In Reply To:请帮忙 Posted by:slwgu at 2005-08-29 12:32:03 > #include <iostream.h> > > int main() > { > long s[10000000]; > long two,three; > s[0]=1; > two=three=0; > long i; > long tmp; > for (i=1;i<10000000;i++) > { > s[i]=s[two]*2+1; > tmp=s[three]*3+1; > if (tmp<s[i]) > { > s[i]=tmp; > three++; > } > else > two++; > } > while (cin>>i) > { > cout<<s[--i]<<endl; > } > return 0; > } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator