2623

// include file
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cctype>
#include <ctime>

#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <bitset>

#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <list>
#include <functional>

using namespace std;

// typedef
typedef __int64 LL;

// 
#define read freopen("in.txt","r",stdin)
#define write freopen("out.txt","w",stdout)

#define Z(a,b) ((a)<<(b))
#define Y(a,b) ((a)>>(b))

const double eps = 1e-6;
const double INFf = 1e100;
const int INFi = 1000000000;
const LL INFll = (LL)1<<62;
const double Pi = acos(-1.0);

template<class T> inline T sqr(T a){return a*a;}
template<class T> inline T TMAX(T x,T y)
{
	if(x>y) return x;
	return y;
}
template<class T> inline T TMIN(T x,T y)
{
	if(x<y) return x;
	return y;
}
template<class T> inline T MMAX(T x,T y,T z)
{
	return TMAX(TMAX(x,y),z);
}
template<class T> inline T MMIN(T x,T y,T z)
{
	return TMIN(TMIN(x,y),z);
}
template<class T> inline void SWAP(T &x,T &y)
{
	T t = x;
	x = y;
	y = t;
}


// code begin
// 1 2 3 4 6 9 12 18 36
bool p[10010];
int stk[10000],top;
int d;
int fp[10010];
int main()
{
	read;
	write;
	for(int i=2;i<=10000;i++)
	{
		if(!p[i])
			for(int j=i+i;j<=10000;j+=i)
				p[j]=1;
	}
	top=0;
	for(int i=2;i<=10000;i++)
		if(!p[i])
			stk[top++]=i;
	memset(fp,0,sizeof(fp));
	for(int i=0;i<10;i++)
	{
		scanf("%d",&d);
		for(int j=0;j<top;j++)
		{
			if(d%stk[j]==0)
			{
				while(d%stk[j]==0)
				{
					fp[stk[j]]++;
					d/=stk[j];
				}
			}
			if(d==1) break;
		}
	}

	LL ans=1;
	for(int i=2;i<=10000;i++)
	{
		if(!p[i])
		{
			if(fp[i]) ans*=fp[i]+1;
		}
	}
	printf("%I64d\n",ans%10);
	return 0;
}
posted @ 2011-05-01 02:50  AC2012  阅读(166)  评论(0)    收藏  举报