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 |
Re:够变态..完全凑对的In Reply To:够变态..完全凑对的 Posted by:mayp at 2007-03-05 10:23:24 > 这样也能0S过,太裸了,一点算法性都没有.. > #include<iostream> > #include<iomanip> > using namespace std; > int a[10001]; > int main() > { > int n; > unsigned long t=1; > a[0]=1; > for(int i=1;i<10001;i++) { > t*=i; > while((t%10)==0) t/=10; > t%=100000; > a[i]=t%10; > } > while(cin>>n) > { > int res; > res=a[n]; > cout<<setw(5)<<n<<" -> "<<res<<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