Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

够变态..完全凑对的

Posted by mayp at 2007-03-05 10:23:24 on Problem 1604
这样也能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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator