Cod sursa(job #3367929)
| Utilizator | Data | 12 octombrie 2026 12:13:05 | |
|---|---|---|---|
| Problema | Indep | Scor | 25 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva de probleme | Marime | 0.5 kb |
#include <fstream>
#include <algorithm>
//#define int long long
using namespace std;
ifstream cin("indep.in");
ofstream cout("indep.out");
using ll= long long;
const int dim= 1e3+ 5;
const int mod= 666013;
ll dp[dim];
int main()
{
int i, j, n, x;
cin >> n;
for(i= 1;i <= n;i++){
cin >> x;
for(j= 1;j <= dim;j++){
int nr= __gcd(j, x);
dp[nr]+= dp[j];
}
dp[x]++;
}
cout << dp[1];
return 0;
}
