fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4. #define for1(i,m,n) for(int i=m;i<=n;i++)
  5. #define for0(i,m,n) for(int i=m;i<n;i++)
  6.  
  7. #define int long long
  8. #define el '\n'
  9. #define fi first
  10. #define se second
  11. #define ii pair<int,int>
  12. #define vll(i) i.begin(),i.end()
  13.  
  14. const int N=1e6;
  15. const int mod=1e9+7;
  16. unordered_map<int,int>mp;
  17. vector<int>v;
  18. bool a[N+9];
  19. void sang(){
  20. for(int i=2;i<=N;i++)
  21. if(a[i]==0){
  22. v.push_back(i);
  23. for(int j=i+i;j<=N;j+=i){
  24. a[j]=1;
  25. }
  26. }
  27. // for1(i,2,N) if(a[i]==0) v.push_back(i);
  28. }
  29. signed main(){
  30. ios_base::sync_with_stdio(0);
  31. cin.tie(0);
  32. cout.tie(0);
  33. // freopen("bai1.INP","r",stdin);
  34. // freopen("bai1.OUT","w",stdout);
  35. sang();
  36. int n;cin>>n;
  37. while(n--){
  38. mp.clear();
  39. int x;cin>>x;
  40. if(x==1) {
  41. cout<<0<<' '<<0;
  42. continue;
  43. }
  44. for(auto u:v){
  45. if(u*u>x) break;
  46. while(x%u==0){
  47. mp[u]++;
  48. x/=u;
  49. }
  50. }
  51. if(x>1) mp[x]++;
  52.  
  53. int ans=1;
  54. for(auto u:mp) {
  55. ans*=(u.se+1);
  56. //cout<<u.fi<<' '<<u.se<<el;
  57. }
  58. if(ans-2==0){
  59. cout<<0<<' '<<0<<el;
  60. }
  61. else
  62. cout<<ans-2<<' '<<mp.size()<<el;
  63. }
  64. return 0;
  65. }
  66.  
Success #stdin #stdout 0.01s 5292KB
stdin
Standard input is empty
stdout
0 1