Cod sursa(job #2527423)
| Utilizator | Data | 20 ianuarie 2020 12:25:41 | |
|---|---|---|---|
| Problema | Indep | Scor | 0 |
| 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(int j=1;j<=1000;j++){
d[__gcd(j,x)]+=d[j];
}
d[x]++;
}
cout<<d[1];
return 0;
}
