Pagini recente » Cod sursa (job #842235) | Cod sursa (job #2424312) | Cod sursa (job #532287) | Cod sursa (job #935951) | Cod sursa (job #2765486)
#include<bits/stdc++.h>
using namespace std;
#define INIT ios_base :: sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define mp make_pair
#define pb push_back
#define ft first
#define sc second
#define ll long long
#define pii pair<int, int>
#define count_bits __builtin_popcount
#define int ll
ifstream fin("indep.in"); ofstream fout("indep.out");
#define cin fin
#define cout fout
int t, n, m, k, a[300010], q, l, r;
int nr[1001][2];
int32_t main(){
INIT
//cout<<__gcd(0, 20)<<"\n";
cin>>n;
nr[0][0]=1;
for(int i=1; i<=n; i++){
cin>>a[i];
for(int gcd=0; gcd<=1000; gcd++){
nr[gcd][1]+=nr[gcd][0];
nr[__gcd(a[i], gcd) ][1]+=nr[gcd][0];
}
for(int gcd=0; gcd<=1000; gcd++){
nr[gcd][0]=nr[gcd][1];
nr[gcd][1]=0;
}
/*
for(int gcd=0; gcd<=6; gcd++){
cout<<nr[gcd][0]<<" ";
}
cout<<"\n";
*/
}
cout<<nr[1][0];
return 0;
}