Cod sursa(job #2527424)
Utilizator | Data | 20 ianuarie 2020 12:27:05 | |
---|---|---|---|
Problema | Indep | Scor | 25 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.36 kb |
#include <fstream>
#include <algorithm>
using namespace std;
ifstream cin("indep.in");
ofstream cout("indep.out");
long long n,x,d[1005];
int main()
{
cin>>n;
for(int i=1;i<=n;i++){
cin>>x;
for(long long j=1;j<=1000;j++){
d[__gcd(j,x)]+=d[j];
}
d[x]++;
}
cout<<d[1];
return 0;
}