Saleh127

CF 1203C.cpp

Jul 20th, 2020
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define test int t; cin>>t; while (t--)
  4. #define ll long long int
  5. #define fellow_junior ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
  6. ll a[400005];
  7. int main()
  8. {
  9. fellow_junior
  10.  
  11. ll c,d=0,e=0,f,i,j,k,l;
  12. cin>>c;
  13. for(i=0;i<c;i++)
  14. {
  15. cin>>a[i];
  16. }
  17. for(i=0;i<c;i++)
  18. {
  19. e=__gcd(e,a[i]);
  20. }
  21. for(i=1;i<=sqrt(e);i++)
  22. {
  23. if(e%i==0)
  24. {
  25. if(i*i==e) d++;
  26. else d+=2;
  27. }
  28. }
  29. cout<<d<<endl;
  30. return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment