约数个数(牢记公式)


公式: 

#include 
#include 
#include 
using namespace std;
const int mod = 1e9 + 7;
int n;

int main()
{
    cin >> n;
    unordered_map<int,int>hash;
    while(n--)
    {
        int x;
        cin >> x;
        for(int i = 2; i <= x / i; i++)
        {
            while(x % i == 0)
            {
                x /= i;
                hash[i]++;
            }
        }
        if(x > 1) hash[x] ++;
    }
    
    long long ans = 1;
    for(auto t : hash) ans = ans * (t.second + 1) % mod;
    
    cout << ans << endl;
    
    return 0;
}