1049
#include <algorithm>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <list>
 
using namespace std;
 
#define INPUT_FILE "xo.in"
#define OUTPUT_FILE "xo.out"
 
int main(void)
{
 
#ifdef ALEX
    freopen("input.in", "r", stdin);
    freopen("output.out", "w", stdout);
#else
//    freopen(INPUT_FILE, "r", stdin);
//    freopen(OUTPUT_FILE, "w", stdout);
#endif
 
    int n;
    int i = 2;
    long long sum = 1;
    map< int, int > m;
 
    for(int j = 0; j < 10; j++)
    {
        cin >> n;
        if(n == 0)
        {
            cout << 0;
            return 0;
        }
        i = 2;
        while( n != 1 )
        {
            if( i >= ((int)sqrt((double)n) + 1) )
            {
                m[n]++;
                break;
            }
 
            int p = 0;
            while( n % i == 0 )
            {
                m[i] ++;
                n = n/i;
            }
            i++;
        }
    }
 
    m[1] = 0;
    long long r = 1;
    for(map<int,int>::iterator it = m.begin(); it != m.end(); it++)
    {
        r *= ((*it).second+1);
    }
 
    cout << r%10;
 
    return 0;
}
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.