#include<bits/stdc++.h>
#define ll unsigned long long int
using namespace std;
ll gcd(ll a, ll b)
{
ll r;
if(a < b)
swap(a, b);
while(b != 0)
{
r = a%b;
a = b;
b = r;
}
return a;
}
int main()
{
ll n, i;
cin >> n;
ll a[n];
ll ans = 0;
for(i=0;i<n;i++)
{
cin >> a[i];
ans = gcd(ans, a[i]);
}
ll c = 0;
for(i=1;i*i*1ll <= ans;i++)
{
if(ans%i == 0)
{
c++;
if(i != ans/i)
c++;
}
}
cout << c << endl;
return 0;
}
#define ll unsigned long long int
using namespace std;
ll gcd(ll a, ll b)
{
ll r;
if(a < b)
swap(a, b);
while(b != 0)
{
r = a%b;
a = b;
b = r;
}
return a;
}
int main()
{
ll n, i;
cin >> n;
ll a[n];
ll ans = 0;
for(i=0;i<n;i++)
{
cin >> a[i];
ans = gcd(ans, a[i]);
}
ll c = 0;
for(i=1;i*i*1ll <= ans;i++)
{
if(ans%i == 0)
{
c++;
if(i != ans/i)
c++;
}
}
cout << c << endl;
return 0;
}
Comments
Post a Comment