Problem:
C: 約数ゲーム / Divisor Game
問題
tsutaj くんは約数ゲームで遊ぼうとしています。
約数ゲームでは、まず
2
以上の自然数
N
が与えられ、その後は以下の手順でゲームが進んでいきます。
N
以外の
N
の約数の中から、整数を
1
つ宣言する。ただしこのとき、既に宣言したことがある整数の約数になるものは宣言できない。
宣言できる整数がある限りこれを繰り返し、宣言できるものがなければゲームは終了する。
ゲームを終了させるまでに行われた宣言の回数としてあり得る数の最小値と最大値を求めてください。
入力形式
入力は
1
行で与えられる。
N
制約
2 \leq N \leq 10^{12}
出力形式
宣言回数の最小値と最大値を、スペース区切りで
1
行に出力せよ。
入力例1
18
出力例1
2 5
宣言回数を
2
回にする一例は以下の通りです。
9
を宣言する。
6
を宣言する。 (
6
は
9
の約数ではないため宣言が可能である)
これを行うと、
18
の約数で
18
でない任意の整数は今まで宣言してきた整数の約数になるため、ゲームが終了します。
既に宣言したことがある整数の約数になるものは宣言できないことに注意してください。例えば、
9
を宣言したあとに
3
を宣言することはできません。なぜなら、
3
は
9
の約数になるからです。
入力例2
99
出力例2
2 5
入力例3
10000000019
出力例3
1 1
入力は
32
bit 整数型に収まらない場合があります。

Submitted solutions:

code_snippet: #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
using ll=long long;

int main(){
  ll n;cin>>n;ll num=n;
  ll ans=0;ll p=0;
  for(ll j=2;j*j<=n;j++){
    if(num%j==0){
      while(num%j==0&&num>0){
	num/=j;
      }
      p++;
    }
  }
  if(num!=1)p++;
  for(ll j=1;j*j<=n;j++){
    if(n%j==0){
      ans++;
      if(n/j!=j)ans++;
    }
  }
  ans--;
  cout<<min(p,ans)<<" "<<ans<<endl;
}
accuracy: 1
time_ms: 10
memory_kb: 3440
final_rank: 6

code_snippet: #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, a, b) for (int i = (a); i < (b); ++i)
#define all(a) (a).begin(), (a).end()

using namespace std;
using ll = int64_t;
using P = pair<int, int>;

const ll INF_L = 1LL << 60;
const int INF_I = 1 << 30;
const int MOD = (int)1e9 + 7;
const double PI = acos(-1);
int dx[] = {1, 0, -1, 0};
int dy[] = {0, -1, 0, 1};

int main()
{
    ll n;
    cin >> n;

    vector<ll> fact;
    for (ll i = 1; i * i < n + 1; i++)
    {
        if (n % i)
            continue;
        fact.push_back(i);
        if (i != n / i)
            fact.push_back(n / i);
    }
    map<int, int> prime;
    ll tmp = n;
    for (ll i = 2; i * i < n + 1; i++)
    {
        while (tmp % i == 0)
        {
            prime[i]++;
            tmp /= i;
        }
    }
    if (tmp != 1)
        prime[tmp]++;
    cout << prime.size() << " " << fact.size() - 1 << "\n";
    return 0;
}

// int main()
// {
//     ll n;
//     cin >> n;

//     vector<ll> fact;
//     for (ll i = 1; i * i < n + 1; i++)
//     {
//         if (n % i)
//             continue;
//         fact.push_back(i);
//         if (i != 1 && i != n / i)
//             fact.push_back(n / i);
//     }
//     sort(all(fact));
//     vector<ll> factb;
//     reverse(all(fact));
//     for (ll f : fact)
//     {
//         bool ok = true;
//         for (ll b : factb)
//         {
//             if (b % f == 0)
//                 ok = false;
//         }
//         if (ok)
//             factb.push_back(f);
//     }

//     cout << factb.size() << " " << fact.size() << "\n";
//     return 0;
// }
accuracy: 1
time_ms: 10
memory_kb: 3448
final_rank: 7

code_snippet: #include <bits/stdc++.h>

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define SP << " " 
#define LLi long long int

using namespace std;

vector<LLi> pri={1, 2, 3};

void PV(vector<int> pvv) {
	rep(i, pvv.size()) cout << pvv[i] SP;
	cout << endl;
}

void PVL(vector<LLi> pvv) {
	rep(i, pvv.size()) cout << pvv[i] SP;
	cout << endl;
}

bool VV(vector<int> vv1, vector<int> vv2) {
	if(vv1.size()!=vv2.size()) return false;
	rep(i, vv1.size()) if(vv1[i]!=vv2[i]) return false;

	return true;
}

bool VVL(vector<LLi> vv1, vector<LLi> vv2) {
	if(vv1.size()!=vv2.size()) return false;
	rep(i, vv1.size()) if(vv1[i]!=vv2[i]) return false;

	return true;
}

//vecotr<LLi>の総和
LLi SML(vector<LLi> smv) {
	LLi tmp=0;
	rep(i, smv.size()) tmp+=smv[i];

	return tmp;
}

//n以下の素数を配列に{1, 2, 3, 5, 7, ...} make_prime_list
//i, j, flag, sqx, xを使用
void mplist(LLi x){
	int flag;

	for(int i=5;i<=x;i+=2){
		flag=0;
		for(int j=1;j<(int)pri.size();j++){
			if(i%pri[j]==0){
				flag=1;
				break;
			}
			if(x<pri[j]*pri[j]) break;
		}
		if(flag==0) pri.emplace_back(i);
	}
}

//nを素因数分解 root_prime_fac
//i, tmp, bin, lmt, xを使用
map<LLi, int> rpfac(LLi x){
	int sqx=ceil(sqrt(x));
	//cout<< "sqx=" << sqx SP << sqx*sqx << endl;//
	auto bin = lower_bound(all(pri), sqx);
	int lmt=bin-pri.begin()+1;
	map<LLi, int> tmp;
	//cout<< "lmt=" << lmt SP << pri[lmt] SP << pri[lmt]*pri[lmt] <<endl;//
	if((int)pri.size()<lmt) cout<< "rpfac: pri size is small" <<endl;

	for(int i=1;i<lmt;i++){
		while(x%pri[i]==0){
			x/=pri[i];
			tmp[pri[i]]++;
			//cout<< x <<endl;
			//tmp[0]++;//0番に何個の積でできてるかをメモれる
		}
		if(x==1) break;
	}

	//if(x!=1) cout<< "prime_fac x=" << x <<endl;
	return tmp;
}

//階乗を素因数分解
map<LLi, int> facfac(LLi x){
	map<LLi, int> tmp;
	auto bin = lower_bound(all(pri), x);
	int lmt=bin-pri.begin()+1;
  	//cout<< "lmt=" << lmt SP << pri[lmt] SP << pri[lmt]*pri[lmt] <<endl;//

	for(LLi i=1;i<lmt;i++){
		int lp=0, di=0;
		while(pow(pri[i], lp)<x){
			lp++;
			di+=x/pow(pri[i], lp);
		}
		if(di>0) tmp[pri[i]]=di;
	}
	
	return tmp;
}

//約数列挙
//i, j, k, tmp, mul, mを使用
vector<LLi> getfac(map<LLi, int> mp){
	vector<LLi> tmp={1}, ad;
	LLi mul;
	
	for (auto p : mp) {
		mul=1;
		ad.clear();
  		LLi key = p.first;
  		int value = p.second;
		  
		rep(j, value){
			mul*=key;
			rep(k, tmp.size()) ad.push_back(tmp[k]*mul);
		}
		rep(j, ad.size()) tmp.push_back(ad[j]);
		//PV(tmp);//
	}

	/*for(int i=1;i<v.size();i++){
		if(v[i]==0) continue;
		mul=1;
		ad.clear();
		rep(j, v[i]){
			mul*=pri[i];
			rep(k, tmp.size()){
				ad.push_back(tmp[k]*mul);
			}
		}
		//PV(tmp);
		rep(j, ad.size()) tmp.push_back(ad[j]);
	}*/

	sort(all(tmp));
	return tmp;
}

//素因数の積を計算
//i, tmp, vを使用
LLi defac(map<LLi, int> mp){
	LLi tmp=1;

	/*for(int i=1;i<v.size();i++){
		if(v[i]!=0) tmp*=pow(pri[i], v[i]);
	}*/

	for (auto p : mp) {
  		LLi key = p.first;
  		int value = p.second;
		tmp*=pow(key, value);
	}

	return tmp;
}

//素数判定 is_prime
//ub, lb, x, iを使用
bool isp(LLi x){
	//if(x==1) return false;//1を素数としないなら有効化
	auto ub = upper_bound(all(pri), x);
	auto lb = lower_bound(all(pri), x);

	//xがでかいときは素数リストで割ってみる
	if(lb==pri.end()){
		for(int i=1;i<(int)pri.size();i++){
			if(x%pri[i]==0) return false;
			if(x<pri[i]*pri[i]) return true;
		}
		//cout<< "isp: pri size is small" <<endl;

		//priのサイズが足りないときは地道にチェックする
		for(LLi i=pri[pri.size()-1]+2;i*i<=x;i+=2){
			if(x%i==0) return false;
		}
		return true;
	}

	return ub!=lb;
}

int main(){

	LLi n, m, ml;
	vector<LLi> v;
	map<LLi, int> mp;

	cin>> m;

	mplist(1000100);//nまでの素数列挙
	//PVL(pri);//
	mp=rpfac(m);//mを√mまで素因数分解
	ml=defac(mp);//mlにmpの総積を代入
	//cout<< "m/ml=" << m/ml SP << isp(m/ml) <<endl;//
	if(m!=ml) mp[m/ml]++;//mpにm/mlを追加(√m以上の素数が約数の場合に必要な処理)
	//mの約数で√m以上の素数は1つしかないのでこれでOK

	for (auto p : mp) {
  		auto key = p.first;
  		auto value = p.second;
		//cout<< key << "^" << value SP;//mpの内訳を表示
	}
	
	v=getfac(mp);//素因数分解から約数を列挙

        cout<< mp.size() << " " << v.size()-1 <<endl;

	return 0;
}
accuracy: 1
time_ms: 130
memory_kb: 3888
final_rank: 16

code_snippet: #include <bits/stdc++.h>

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define SP << " " 
#define LLi long long int

using namespace std;

vector<LLi> pri={1, 2, 3};

void PV(vector<int> pvv) {
	rep(i, pvv.size()) cout << pvv[i] SP;
	cout << endl;
}

void PVL(vector<LLi> pvv) {
	rep(i, pvv.size()) cout << pvv[i] SP;
	cout << endl;
}

bool VV(vector<int> vv1, vector<int> vv2) {
	if(vv1.size()!=vv2.size()) return false;
	rep(i, vv1.size()) if(vv1[i]!=vv2[i]) return false;

	return true;
}

bool VVL(vector<LLi> vv1, vector<LLi> vv2) {
	if(vv1.size()!=vv2.size()) return false;
	rep(i, vv1.size()) if(vv1[i]!=vv2[i]) return false;

	return true;
}

//vecotr<LLi>の総和
LLi SML(vector<LLi> smv) {
	LLi tmp=0;
	rep(i, smv.size()) tmp+=smv[i];

	return tmp;
}

//n以下の素数を配列に{1, 2, 3, 5, 7, ...} make_prime_list
//i, j, flag, sqx, xを使用
void mplist(LLi x){
	int flag;

	for(int i=5;i<=x;i+=2){
		flag=0;
		for(int j=1;j<(int)pri.size();j++){
			if(i%pri[j]==0){
				flag=1;
				break;
			}
			if(x<pri[j]*pri[j]) break;
		}
		if(flag==0) pri.emplace_back(i);
	}
}

//nを素因数分解 root_prime_fac
//i, tmp, bin, lmt, xを使用
map<LLi, int> rpfac(LLi x){
	int sqx=ceil(sqrt(x));
	//cout<< "sqx=" << sqx SP << sqx*sqx << endl;//
	auto bin = lower_bound(all(pri), sqx);
	int lmt=bin-pri.begin()+1;
	map<LLi, int> tmp;
	//cout<< "lmt=" << lmt SP << pri[lmt] SP << pri[lmt]*pri[lmt] <<endl;//
	if((int)pri.size()<lmt) cout<< "rpfac: pri size is small" <<endl;

	for(int i=1;i<lmt;i++){
		while(x%pri[i]==0){
			x/=pri[i];
			tmp[pri[i]]++;
			//cout<< x <<endl;
			//tmp[0]++;//0番に何個の積でできてるかをメモれる
		}
		if(x==1) break;
	}

	//if(x!=1) cout<< "prime_fac x=" << x <<endl;
	return tmp;
}

//階乗を素因数分解
map<LLi, int> facfac(LLi x){
	map<LLi, int> tmp;
	auto bin = lower_bound(all(pri), x);
	int lmt=bin-pri.begin()+1;
  	//cout<< "lmt=" << lmt SP << pri[lmt] SP << pri[lmt]*pri[lmt] <<endl;//

	for(LLi i=1;i<lmt;i++){
		int lp=0, di=0;
		while(pow(pri[i], lp)<x){
			lp++;
			di+=x/pow(pri[i], lp);
		}
		if(di>0) tmp[pri[i]]=di;
	}
	
	return tmp;
}

//約数列挙
//i, j, k, tmp, mul, mを使用
vector<LLi> getfac(map<LLi, int> mp){
	vector<LLi> tmp={1}, ad;
	LLi mul;
	
	for (auto p : mp) {
		mul=1;
		ad.clear();
  		LLi key = p.first;
  		int value = p.second;
		  
		rep(j, value){
			mul*=key;
			rep(k, tmp.size()) ad.push_back(tmp[k]*mul);
		}
		rep(j, ad.size()) tmp.push_back(ad[j]);
		//PV(tmp);//
	}

	/*for(int i=1;i<v.size();i++){
		if(v[i]==0) continue;
		mul=1;
		ad.clear();
		rep(j, v[i]){
			mul*=pri[i];
			rep(k, tmp.size()){
				ad.push_back(tmp[k]*mul);
			}
		}
		//PV(tmp);
		rep(j, ad.size()) tmp.push_back(ad[j]);
	}*/

	sort(all(tmp));
	return tmp;
}

//素因数の積を計算
//i, tmp, vを使用
LLi defac(map<LLi, int> mp){
	LLi tmp=1;

	/*for(int i=1;i<v.size();i++){
		if(v[i]!=0) tmp*=pow(pri[i], v[i]);
	}*/

	for (auto p : mp) {
  		LLi key = p.first;
  		int value = p.second;
		tmp*=pow(key, value);
	}

	return tmp;
}

//素数判定 is_prime
//ub, lb, x, iを使用
bool isp(LLi x){
	//if(x==1) return false;//1を素数としないなら有効化
	auto ub = upper_bound(all(pri), x);
	auto lb = lower_bound(all(pri), x);

	//xがでかいときは素数リストで割ってみる
	if(lb==pri.end()){
		for(int i=1;i<(int)pri.size();i++){
			if(x%pri[i]==0) return false;
			if(x<pri[i]*pri[i]) return true;
		}
		//cout<< "isp: pri size is small" <<endl;

		//priのサイズが足りないときは地道にチェックする
		for(LLi i=pri[pri.size()-1]+2;i*i<=x;i+=2){
			if(x%i==0) return false;
		}
		return true;
	}

	return ub!=lb;
}

int main(){

	LLi n, m, ml;
	vector<LLi> v;
	map<LLi, int> mp;

	cin>> m;

	mplist(1000000);//nまでの素数列挙
	//PVL(pri);//
	mp=rpfac(m);//mを√mまで素因数分解
	ml=defac(mp);//mlにmpの総積を代入
	//cout<< "m/ml=" << m/ml SP << isp(m/ml) <<endl;//
	if(m!=ml) mp[m/ml]++;//mpにm/mlを追加(√m以上の素数が約数の場合に必要な処理)
	//mの約数で√m以上の素数は1つしかないのでこれでOK

	for (auto p : mp) {
  		auto key = p.first;
  		auto value = p.second;
		//cout<< key << "^" << value SP;//mpの内訳を表示
	}
	
	v=getfac(mp);//素因数分解から約数を列挙

        cout<< mp.size() << " " << v.size()-1 <<endl;

	return 0;
}
accuracy: 0.5853658536585366
time_ms: 130
memory_kb: 3884
final_rank: 18

code_snippet: // vim: shiftwidth=2 expandtab foldmethod=marker

// include {{{
#include <algorithm>
#include <cassert>
#include <chrono>
#include <cmath>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
// }}}

// debug(...) {{{
#ifdef LOCAL_DEBUG
#include "./debug.h"
#else
bool debug_enabled = false;
#define debug(...)
#define debugn(...)
#define debug_reset()
#endif

// }}}

// bin {{{
template <class T>
std::string bin(int bits, const T& x) {
  char buf[bits + 1];
  buf[bits] = '\0';
  for (int i = 0; i < bits; i++) {
    if ((x >> i) & 1) {
      buf[bits - i - 1] = '1';
    } else {
      buf[bits - i - 1] = '0';
    }
  }
  return std::string(buf);
}
std::string bin(int x) {
  if (x < 0) return bin(32, x);
  for (int i = 4; i < 31; i++) {
    int y = 1 << i;
    if (x < y) return bin(i, x);
  }
  return bin(32, x);
}
// }}}

// misc {{{
using namespace std;
template <class T, class U>

using umap = unordered_map<T, U>;
template <class T>
using uset = unordered_set<T>;

typedef long long ll;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)

template <class T>
void sort(T& arr) {  // {{{
  std::sort(arr.begin(), arr.end());
}  // }}}
template <class T, class By>
void sort_by(T& arr, By by) {  // {{{
  std::sort(arr.begin(), arr.end(), [by](auto l, auto r) { return by(l) < by(r); });
}  // }}}

template <class T>
void reverse(T& arr) {  // {{{
  std::reverse(arr.begin(), arr.end());
}  // }}}

class Random {  // {{{
 public:
  std::uniform_int_distribution<> uniform_int;
  std::mt19937 rnd;
  std::bernoulli_distribution bern_dist;
  int uniform(int l, int r) {
    return uniform_int(rnd, std::uniform_int_distribution<>::param_type(l, r));
  }
  int next(int N) {
    return uniform(0, N - 1);
  }
  int bern(double p) {
    return bern_dist(rnd, std::bernoulli_distribution::param_type(p));
  }
};  // }}}

template <class A>
ostream& out_vec(const vector<A>& x, const string& sep) {  // {{{
  rep(i, x.size()) {
    cout << x[i];
    if (i < x.size() - 1) cout << sep;
  }
  return cout;
}  // }}}

bool ends_with(const string& s, const string& x) {
  if(s.length() < x.length()) return false;
  for(int i = 0; i < x.size(); i++) {
    if(s[s.size() - 1 - i] != x[x.size() - 1 - i]) return false;
  }
  return true;
}
// }}}

// modulo {{{
ll modpow(ll a, ll n, ll mod) {
  ll res = 1;
  while (n > 0) {
    if (n & 1) res = res * a % mod;
    a = a * a % mod;
    n >>= 1;
  }
  return res;
}

ll modplus(ll a, ll b, ll mod) {
  ll x = ((a % mod) + (b % mod)) % mod;
  if (x < 0) x += mod;
  return x;
}

ll modminus(ll a, ll b, ll mod) {
  return modplus(a, -b, mod);
}

// }}}

class UnionFind {  // {{{
  vector<int> parent;

 public:
  UnionFind(int N) : parent(N) {
    rep(i, N) parent[i] = i;
  }

  int root(int x) {
    if (parent[x] == x)
      return x;
    else
      return parent[x] = root(parent[x]);
  }

  void unite(int x, int y) {
    int rx = root(x);
    int ry = root(y);
    if (rx != ry) { parent[rx] = ry; }
  }
};  // }}}

// modulo {{{
// https://qiita.com/drken/items/3b4fdf0a78e7a138cd9a
long long modinv(long long a, long long m) {
  long long b = m, u = 1, v = 0;
  while (b) {
    long long t = a / b;
    a -= t * b;
    swap(a, b);
    u -= t * v;
    swap(u, v);
  }
  u %= m;
  if (u < 0) u += m;
  return u;
}

ll modfact(ll a, ll m) {
  ll x = 1;
  for (ll i = 2; i <= a; i++) {
    x *= i;
    x %= m;
  }
  return x;
}

ll mod_P(ll n, ll r, ll m) {
  ll x = 1;
  for (ll i = n - r + 1; i <= n; i++) {
    x *= i;
    x %= m;
  }
  return x;
}

ll mod_C(ll n, ll r, ll m) {
  return mod_P(n, r, m) * modinv(modfact(r, m), m) % m;
}

// }}}

// main {{{
void solve();
int main() {
  cout << setprecision(20);
  solve();
}
// }}}

void solve() {
  ll N;
  cin >> N;
  vector<bool> sieve(1e7);
  vector<ll> primes;
  for(ll i = 2; i * i <= N; i++) {
    if(sieve[i]) continue;
    primes.push_back(i);
    for(ll j = i * 2; j < sieve.size(); j += i) sieve[j] = true; 
  }
  debugn(primes);
  vector<ll> c;
  ll M = N;
  rep(i, primes.size()) {
    int x = 0;
    while(M % primes[i] == 0) {
      x++;
      M /= primes[i];
    }
    if(x > 0) {
      debugn(primes[i], x);
      c.emplace_back(x);
    }
  }
  if(M > 1) c.emplace_back(1);
  debugn(c);
  ll makusu = 1;
  rep(i, c.size()) makusu *= (c[i] + 1);
  makusu--;

  ll minn = c.size();

  cout << minn << ' ' << makusu << endl;
}
accuracy: 1
time_ms: 30
memory_kb: 5148
final_rank: 13

code_snippet: #include<iostream>
using namespace std;
int main(){
    long long n;
    cin >> n;

    int cnt = 0;
    long long tmp = n;
    for(long long i = 2; i*i <= n; i++){
        if(tmp%i == 0){
            cnt++;
            while(tmp%i == 0)tmp /= i;
        }
    }
    if(tmp > 1){
        //tmpが1以上のとき、Nには√Nより大きい素因数をもつ
        cnt++;
    }

    cout << cnt << " ";
    cnt = 0;
    for(long long i = 1; i*i <= n; i++){
        if(n%i == 0){ //iはnの約数
            cnt++;
            if(i*i != n)cnt++;//n/iの分もカウントする
        }
    }

    cout << cnt-1 << endl;
}
accuracy: 1
time_ms: 10
memory_kb: 3116
final_rank: 4

code_snippet: /*  -*- coding: utf-8 -*-
 *
 * 2932.cc: 
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
 
using namespace std;

/* constant */

const int MAX_N = 100;
const int MAX_P = 1000000 + 50;

/* typedef */

typedef long long ll;

/* global variables */

bool primes[MAX_P + 1];
int pnums[MAX_P + 1];

/* subroutines */

int gen_primes(int maxp, int pnums[]) {
  memset(primes, true, sizeof(primes));
  primes[0] = primes[1] = false;

  int p, pn = 0;
  for (p = 2; p * p <= maxp; p++)
    if (primes[p]) {
      pnums[pn++] = p;
      for (int q = p * p; q <= maxp; q += p) primes[q] = false;
    }
  for (; p <= maxp; p++)
    if (primes[p]) pnums[pn++] = p;
  return pn;
}

/* main */

int main() {
  int pn = gen_primes(MAX_P, pnums);
  //printf("pn=%d\n", pn);

  ll n;
  scanf("%lld", &n);

  int maxc = 0;
  for (ll p = 1; p * p <= n; p++)
    if (n % p == 0) {
      ll q = n / p;
      maxc += (p != q) ? 2 : 1;
    }

  ll r = n;
  int minc = 0;
  for (int i = 0; (ll)pnums[i] * pnums[i] <= r; i++) {
    int &pi = pnums[i];
    if (r % pi == 0) {
      minc++;
      while (r % pi == 0) r /= pi;
    }
  }
  if (r > 1) minc++;

  printf("%d %d\n", minc, maxc - 1);
  return 0;
}
accuracy: 1
time_ms: 10
memory_kb: 4516
final_rank: 10

code_snippet: #include <bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
#define int long long
using namespace std;
typedef pair<int,int>P;
typedef pair<P,int>P2;
#define fi first
#define se second
 
typedef long long ll;
struct NT{
  ll m;  // mod
  vector<bool>ismrime;
  vector<ll> euler;
  vector<ll> fact;
 
  NT(ll MOD){
    m=MOD;
    fact.resize(500009);
    fact[0]=1;
    for(ll i=1;i<500009;i++){
      fact[i]=(fact[i-1]*i)%MOD;
    }
  }
 
  void eratos(int n){
    ismrime.resize(n+1);
    for(int i=0;i<=n;i++) ismrime[i]=true;
    ismrime[0]=0;
    ismrime[1]=0;
    for(int i=2;i<=n;i++){
      if(ismrime[i]){
        for(int j=i+i;j<=n;j+=i) ismrime[j]=false;
      }
    }
  }
 
  // 因数分解 √N
  vector<int> mrime_decommosition(ll x){
    vector<int>res;
    for(int i=2;i*i<=x;i++){
      while(x%i==0){
        x/=i;
        res.push_back(i);
      }
    }
    if(x!=1) res.push_back(x);
    return res;
  }
 
  // 約数列挙 √N
  vector<ll> divisor(ll x){
    vector<ll> res;
    for(ll i=1; i*i<=x ;i++)
      if(x%i==0){
        res.push_back(i);
        if(i*i!=x) res.push_back(x/i);
      }
    sort(res.begin(), res.end());
    return res;
  }
 
  // a*b>LONG_MAX ? 
  bool overflow(ll a,ll b,ll LONGMAX){return a > LONGMAX/b;}
 
  ll extgcd(ll a,ll b,ll& x,ll& y){
    ll d = a ;
    if ( b != 0 ) {
      d = extgcd( b , a%b , y , x ) ;
      y -= ( a / b ) * x ;
    }else{
      x = 1 ; y = 0 ;
    }
    return d;
  }
  ll mod_inverse(ll a){
    ll x , y ;
    extgcd( a , m , x , y ) ;
    return ( m + x % m ) % m ;
  }
 
  // オイラー関数√N
  ll euler_mhi(ll n){
    ll res = n;
    for(ll i=2; i*i <= n ; i++){
      if( n%i == 0 ){
        res = res/i*(i-1);
        for(;n%i==0;n/=i);
      }
    }
    if(n!=1)res=res/n*(n-1);
    return res;
  }
 
  void make_euler_table(int n){
    euler.resize(n+1);
    for(int i=0;i<n;i++) euler[i]=i;
    for(int i=2;i<n;i++){
      if(euler[i]==i){
        for(int j=i;j<n;j+=i){
          euler[j]=euler[j]/i*(i-1);
        }
      }
    }
  }
 
  // n! と nCr 
  // mはmod
  ll mod_fact(ll n,ll& e){
    e=0;
    if(n==0)return 1;
 
    int res = mod_fact(n/m,e);
    e+=n/m;
 
    if(n/m%2 != 0)return res*(m-fact[n%m])%m;
    return res*fact[n%m]%m;
  }
 
  ll combination(ll n,ll k){
    if(n==k||k==0)return 1;
    if(n<0 || k<0 || n<k)return 0;
    ll e1,e2,e3;
    ll a1 = mod_fact(n,e1);
    ll a2 = mod_fact(k,e2);
    ll a3 = mod_fact(n-k,e3);
    return a1*mod_inverse(a2*a3%m)%m;
  }
 
  ll stupid_combination(ll n,ll k){
    if(n==k||k==0)return 1;
    if(n<0 || k<0 || n<k)return 0;
    ll res=1;
    for(ll i=0;i<k;i++){
      res*=(n-i)%m;
      res%=m;
      res*=mod_inverse(i+1);
      res%=m;
    }
    return res;
  }
 
  ll mod_mult(ll a, ll b,ll m) {
    ll res = 0;
    ll exm = a % m;
    while (b) {
      if (b & 1) {
        res += exm;
        if (res > m) res -= m;
      }
      exm <<= 1;
      if (exm > m) exm -= m;
      b >>= 1;
    }
    return res;
  }
 
  ll mod_exm(ll a, ll b,ll m) {
    ll res = 1;
    ll exm = a % m;
    while (b) {
      if (b & 1) res = mod_mult(res, exm,m);
      exm = mod_mult(exm, exm,m);
      b >>= 1;
    }
    return res;
  }
 
  map<ll,ll> moebius(ll n){
    map<ll,ll>res;
    vector<ll>prime;
    for( int i=2; i*i<=n ;i++){
      if(n%i==0){
        prime.push_back(i);
        while(n%i==0)n/=i;
      }
    }
    if(n!=1)prime.push_back(n);
    int m=prime.size();
    for(int i=0;i<(1<<m);i++){
      int mu=1,d=1;
      for(int j=0;j<m;j++){
        mu*=-1;
        d*=prime[j];
      }
      res[d]=mu;
    }
    return res;
  }
 
  // 確率的高速素数判定　
  bool miller_rabin(ll n, ll times=10) {
    if (n < 2) return false;
    if (n == 2) return true;
    if (!(n & 1)) return false;
    ll q = n-1;
    int k = 0;
    while (q % 2 == 0) {
      k++;
      q >>= 1;
    }
    for (int i = 0; i < times; i++) {
      ll a = rand() % (n-1) + 1;
      ll x = mod_exm(a, q, n);
      if (x == 1) continue;
      bool found = false;
      for (int j = 0; j < k; j++) {
        if (x == n-1) {
          found = true;
          break;
        }
        x = mod_mult(x, x, n);
      }
      if (found) continue;
      return false;
    }
    return true;
  }
 
  ll pollard_rho(ll n, int c) {
    ll x = 2;
    ll y = 2;
    ll d = 1;
    while (d == 1) {
      x = mod_mult(x, x, n) + c;
      y = mod_mult(y, y, n) + c;
      y = mod_mult(y, y, n) + c;
      d = __gcd((x-y >= 0 ? x-y : y-x), n);
    }
    if (d == n) return pollard_rho(n, c+1);
    return d;
  }
  ll GCD(ll a,ll b){
    if((a%b)==0)return b;
    return GCD(b,a%b);
  }
  ll LCM(ll a,ll b){
    return a*b/GCD(a,b);
  }
  ll montmort(ll k){  // 完全順列 撹乱順列 indexが全部違う順列
    if( k == 0 ) return 1;
    if( k == 1 ) return 0;
    if( k == 2 ) return 1;
    ll i = 2;
    ll a = 0 , b = 1;
    while( i < k ){
      ll t = ( i * ( ( a + b ) % m ) ) % m;
      a = b; b = t; i++;
    }
    return b;
  }
  vector<ll> monmort_dp(ll k){
    vector<ll> dp(200009);
    dp[0] = 1;
    dp[1] = 0;
    dp[2] = 1;
    for(int i=3;i<200009;i++){
      dp[i] = ( i * ( ( dp[i-1] + dp[i-2] ) % m ) ) %m;
    }
    return dp;
  }
  ll nHr(ll n,ll k){ // 重複組合せ
    return stupid_combination(n+k-1,k);
  }
};
 
signed main(){
  NT N(1000000009);
  long long n;
  cin>>n;
  vector<long long>v=N.mrime_decommosition(n);
  set<long long>s;
  r(i,v.size()){
    s.insert(v[i]);
  }
  vector<long long>V=N.divisor(n);
  cout<<s.size()<<' '<<V.size()-1<<endl;
}
accuracy: 1
time_ms: 10
memory_kb: 6636
final_rank: 15

code_snippet: #include <stdio.h>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <list>
#include <iterator>
#pragma warning(disable:4996)
 
typedef long long ll;
#define MIN(a, b) ((a)>(b)? (b): (a))
#define MAX(a, b) ((a)<(b)? (b): (a))
#define LINF 9223300000000000000
#define INF 2140000000
#define MOD 1000000007
using namespace std;

vector<long> pp;

void preparePrime( long maxp )
{
    long i;
    vector<long> a(maxp+1);
    for(i=2; i<=maxp; i++) {
        long k=i+i;
        while(k<=maxp) {
            a[k]=1;
            k+=i;
        }
    }
    for(i=2; i<=maxp; i++) {
        if(a[i]==0) pp.push_back( i );
    }
    return;
}

void decompositPrime( ll a, vector<pair<ll,ll> >& vv )
{
    preparePrime( (long)sqrt((double)a) );

    long i;
    for(i=0; i<(long)pp.size(); i++) {
        long count = 0;
        while(a % pp[i] == 0 ) {
            a /= pp[i];
            count ++;
        }
        if(count>0) vv.push_back( make_pair( pp[i], count ) );
        if (a==1) break;
    }
    if(a>1) {
        vv.push_back( make_pair( a, 1 ) );
    }

    return;
}

int main(int argc, char* argv[])
{
    ll n;
    scanf("%lld", &n);

    vector<pair<ll,ll> > vv;
    decompositPrime( n, vv );

    ll num = vv.size();
    ll ans = 1;
    long i;
    for(i=0; i<num; i++) {
        ans *= (vv[i].second+1);
    }

    printf("%lld %lld\n", num, ans-1 );

    return 0;
}
accuracy: 1
time_ms: 30
memory_kb: 11184
final_rank: 17

code_snippet: #include<bits/stdc++.h>
#define FOR(i, a, b) for (int i = a; i < b; ++i)
#define rep(N) for (int i = 0; i < N; ++i)
#define Rep(a, b) for (int i = a; i < b; ++i)
#define For(i, N) for (int i = 0; i < N; ++i)
#define all(v) v.begin(), v.end()
#define rev(v) v.rbegin(), v.rend()
#define makei(N) int N; cin >> N;
#define makel(N) ll N; cin >> N;
#define makes(s) string s; cin >> s;
#define maked(d) double d; cin >> d;
#define makev(v, N) vi v(N); rep(N)cin >> v[i];
#define mod 1000000007
#define distance(x1,y1,x2,y2) sqrt((x1 - x2)*(x1 - x2) + (y1 - y2)*(y1 - y2));

using namespace std;
using ll = long long int;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vector<bool>>;
using vs = vector<string>;
using pii = pair<int, int>;
using pis = pair<int, string>;
using msi = map<string, int>;

template<typename T>
void say(T s) {
	cout << s << "\n";
}

template<typename T>
void say(vector<T> s) {
	auto itr = s.begin();
	if (itr == s.end())return;
	cout << *(itr++);
	while (itr != s.end()) {
		cout << " " << *(itr++);
	}
	cout << "\n";
}

void yn(bool b) {
	if (b)say("yes");
	else say("no");
}

void Yn(bool b) {
	if (b)say("Yes");
	else say("No");
}

void YN(bool b) {
	if (b)say("YES");
	else say("NO");
}

template<typename T>
void maxi(T& a, T b) {
	a = max(a, b);
}

template<typename T>
void mini(T& a, T b) {
	a = min(a, b);
}

void exact_say(double x) {
	cout << setprecision(numeric_limits<double>::max_digits10) << x << endl;
}

template<class T> void getVector(vector<T>& v) {
	for (int i = 0; i < v.size(); ++i)
		cin >> v[i];
}

vector<ll> enum_div(ll n) {//約数列挙
	vector<ll> ans;
	for (ll i = 1; i * i <= n; ++i) {
		if (n % i == 0) {
			ans.push_back(i);
			if (i != 1 && i * i != n) {
				ans.push_back(n / i);
			}
		}
	}
	return ans;
}

int main() {
	ll n;
	cin >> n;
	vector<ll> st = enum_div(n);
	sort(all(st));
	ll Min = 0;
	ll Max = st.size();
	while (st.size() > 0) {
		Min++;
		ll a = st.back();
		st.erase(st.end() - 1);
		vector<ll> ay = enum_div(a);
		for (auto it = ay.begin(); it != ay.end(); ++it) {
			auto ity = equal_range(all(st), *it);
			st.erase(ity.first, ity.second);
		}
	}
	cout << Min << " " << Max << endl;
}
accuracy: 1
time_ms: 20
memory_kb: 3156
final_rank: 8

code_snippet: #include <bits/stdc++.h>
using namespace std;
#define MAX 2000000
int p[MAX];

void Eratosthenes(){
	for(int i = 0; i < MAX; i++){
		p[i] = 1;
	}
	p[0] = 0; p[1] = 0;
	for(int i = 2; i < sqrt(MAX); i++){
		if(p[i]){
			for(int j = 0; i * (j + 2) < MAX; j++){
				p[i *(j + 2)] = 0;
			}
		}
	}
}

int main(void){
	long long N;
	long long a = 0, b = 1;
	cin >> N;
	Eratosthenes();
	int sq = sqrt(N);
	for(int i = 0; i <= N; ++i){
		if(!p[i]) continue;
		if(N % (long long)i == 0LL){
			a++;
			long long tmp = 1;
			while(N % (long long)i == 0LL){
				tmp++;
				N /= i;
			}
			b *= tmp;
		}
		if(i > sq && a == 0) break;
	}
	if(a == 0){
		cout << 1 << " " << 1 << endl;
	}else{
		cout << a << " " << b-1 << endl;
	}
	return 0;
}
accuracy: 0.36585365853658536
time_ms: 10
memory_kb: 10904
final_rank: 19

code_snippet: #include "bits/stdc++.h"
using namespace std;
#ifdef _DEBUG
#include "dump.hpp"
#else
#define dump(...)
#endif

#define int long long
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = 1'000'000'007;
template<class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return true; } return false; }

// エラトステネスの篩
vector<char> eratos(int n) {
	vector<char> is_prime(n + 1, true);
	is_prime[0] = is_prime[1] = false;
	for (int i = 2; i*i <= n; i++)
		if (is_prime[i]) {
			int j = i + i;
			while (j <= n) {
				is_prime[j] = false;
				j += i;
			}
		}
	return is_prime;
}
// n以下の素数
vector<int> getPrimes(int n) {
	vector<char> is_prime = eratos(n);
	vector<int> primes;
	for (int i = 0; i < n + 1; i++)
		if (is_prime[i])
			primes.emplace_back(i);
	return primes;
}
// 素因数分解 昇順
// √x以下の素数に対して割り切れるか調べる
vector<int> primeFactorization(int x) {
	vector<int> primes = getPrimes(sqrt(x));
	vector<int> factors;
	for (auto &p : primes) {
		while (x%p == 0) {
			x /= p;
			factors.emplace_back(p);
		}
	}
	if (x != 1)factors.emplace_back(x);
	return factors;
}
vector<int> getDivisors(int x) {
	vector<int> ret;
	int i;
	for (i = 1; i*i < x; i++) {
		if (x%i)continue;
		ret.emplace_back(i);
		ret.emplace_back(x / i);
	}
	if (i*i == x)
		ret.emplace_back(i);
	return ret;
}


signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int N; cin >> N;

	vector<int> factors = primeFactorization(N);
	vector<int> divisors = getDivisors(N);

	dump(factors);

	map<int, int> mp;
	for (auto f : factors)mp[f]++;

	int maxi = 0;
	int mini = 0;

	maxi = divisors.size() - 1;
	mini = mp.size();

	cout << mini << " " << maxi << endl;

	return 0;
}
accuracy: 1
time_ms: 10
memory_kb: 4900
final_rank: 12

code_snippet: #include <cstdio>
#include <iostream>
#include <string>
#include <vector>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <typeinfo>
#include <numeric>
#include <functional>
#include <unordered_map>
#include <bitset>
#include <stack>


using namespace std;
using ll = long long;
using ull = unsigned long long;

const ll INF = 1e16;
const ll MOD = 1e9 + 7;

#define REP(i, n) for(ll i = 0; i < n; i++)






int main() {
    ll n;
    cin >> n;
    vector<ll> y = {1};
    for(ll i = 2; i <= sqrt(n); i++){
        if(n % i == 0){
            y.push_back(i);
            y.push_back(n / i);
        }
    }
    sort(y.begin(), y.end());
    y.erase(unique(y.begin(), y.end()), y.end());
    map<ll, bool> out;
    vector<ll> v;
    for(ll i = y.size() - 1; i >= 1; i--){
        if(out[y[i]]) continue;
        v.push_back(y[i]);
        for(ll j = 2; j <= sqrt(y[i]); j++){
            if(y[i] % j == 0){
                out[j] = true;
                out[y[i] / j] = true;
            }
        }
    }
    if(v.empty()) v.push_back(1);
    cout << v.size() << " " << y.size() << endl;
}
accuracy: 1
time_ms: 20
memory_kb: 3160
final_rank: 9

code_snippet: #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <cstring>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <list>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <unordered_set>
#include <unordered_map>
#include <array>
#include <cassert>
#include <bitset>
using namespace std;
using LL = long long;

LL N;

int main(void)
{
	cin >> N;
	LL s = (LL)sqrt(N);
	LL big = 0;
	for (LL i = 1; i <= s; ++i) {
		if (N % i == 0) {
			++big;
			if (N != i * i) {
				++big;
			}
		}
	}
	big--;
	LL small = 0;
	for (LL i = 2; i <= s; ++i) {
		if (N % i == 0) {
			++small;
			while (N % i == 0)N /= i;
		}
	}
	if (N != 1)++small;
	cout << small << " " << big << endl;
	return 0;
}
accuracy: 1
time_ms: 10
memory_kb: 3100
final_rank: 3

code_snippet: #include<bits/stdc++.h>
using namespace std;

template<size_t max_N, size_t prime_size>
struct Prime{
    bool sieve[max_N];
    int_fast64_t prime[prime_size];
    size_t counter = 0;
    Prime() : sieve(), prime() {
        for(int_fast64_t i = 0; i < max_N; ++i)
            sieve[i] = true;
        sieve[0] = sieve[1] = false;
        for(int_fast64_t i = 2; i < max_N; ++i){
            if(sieve[i]){
                prime[counter] = i;
                ++counter;
                if(counter > prime_size)break;
            }
            for(int_fast64_t j = i * i; j < max_N; j += i)
                sieve[j] = false;
        }
    }
};

auto p = Prime<1000000, 78498>();

int main(){
    long N, M;
    cin >> N;
    M = N;
    long ans(0);
    vector<long> tapi;
    long i;
    for(i = 1; i * i < N; ++i){
        if(N % i == 0){
            if(p.sieve[i]){
                ++ans;
                while(M % i == 0)M /= i;
            }
            tapi.push_back(i);
            tapi.push_back(N / i);
        }
    }
    if(i * i == N)tapi.push_back(i);
    if(M != 1)++ans;
    cout << ans << " " << tapi.size() - 1 << endl;
    return 0;
}
accuracy: 1
time_ms: 10
memory_kb: 4736
final_rank: 11

code_snippet: #include <bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
#define int long long
using namespace std;
typedef pair<int,int>P;
typedef pair<P,int>P2;
#define fi first
#define se second

typedef long long ll;
struct NT{
  ll m;  // mod
  vector<bool>ismrime;
  vector<ll> euler;
  vector<ll> fact;

  NT(ll MOD){
    m=MOD;
    fact.resize(500009);
    fact[0]=1;
    for(ll i=1;i<500009;i++){
      fact[i]=(fact[i-1]*i)%MOD;
    }
  }

  void eratos(int n){
    ismrime.resize(n+1);
    for(int i=0;i<=n;i++) ismrime[i]=true;
    ismrime[0]=0;
    ismrime[1]=0;
    for(int i=2;i<=n;i++){
      if(ismrime[i]){
        for(int j=i+i;j<=n;j+=i) ismrime[j]=false;
      }
    }
  }

  // 因数分解 √N
  vector<int> mrime_decommosition(ll x){
    vector<int>res;
    for(int i=2;i*i<=x;i++){
      while(x%i==0){
        x/=i;
        res.push_back(i);
      }
    }
    if(x!=1) res.push_back(x);
    return res;
  }

  // 約数列挙 √N
  vector<ll> divisor(ll x){
    vector<ll> res;
    for(ll i=1; i*i<=x ;i++)
      if(x%i==0){
        res.push_back(i);
        if(i*i!=x) res.push_back(x/i);
      }
    sort(res.begin(), res.end());
    return res;
  }

  // a*b>LONG_MAX ? 
  bool overflow(ll a,ll b,ll LONGMAX){return a > LONGMAX/b;}

  ll extgcd(ll a,ll b,ll& x,ll& y){
    ll d = a ;
    if ( b != 0 ) {
      d = extgcd( b , a%b , y , x ) ;
      y -= ( a / b ) * x ;
    }else{
      x = 1 ; y = 0 ;
    }
    return d;
  }
  ll mod_inverse(ll a){
    ll x , y ;
    extgcd( a , m , x , y ) ;
    return ( m + x % m ) % m ;
  }

  // オイラー関数√N
  ll euler_mhi(ll n){
    ll res = n;
    for(ll i=2; i*i <= n ; i++){
      if( n%i == 0 ){
        res = res/i*(i-1);
        for(;n%i==0;n/=i);
      }
    }
    if(n!=1)res=res/n*(n-1);
    return res;
  }

  void make_euler_table(int n){
    euler.resize(n+1);
    for(int i=0;i<n;i++) euler[i]=i;
    for(int i=2;i<n;i++){
      if(euler[i]==i){
        for(int j=i;j<n;j+=i){
          euler[j]=euler[j]/i*(i-1);
        }
      }
    }
  }

  // n! と nCr 
  // mはmod
  ll mod_fact(ll n,ll& e){
    e=0;
    if(n==0)return 1;

    int res = mod_fact(n/m,e);
    e+=n/m;

    if(n/m%2 != 0)return res*(m-fact[n%m])%m;
    return res*fact[n%m]%m;
  }

  ll combination(ll n,ll k){
    if(n==k||k==0)return 1;
    if(n<0 || k<0 || n<k)return 0;
    ll e1,e2,e3;
    ll a1 = mod_fact(n,e1);
    ll a2 = mod_fact(k,e2);
    ll a3 = mod_fact(n-k,e3);
    return a1*mod_inverse(a2*a3%m)%m;
  }

  ll stupid_combination(ll n,ll k){
    if(n==k||k==0)return 1;
    if(n<0 || k<0 || n<k)return 0;
    ll res=1;
    for(ll i=0;i<k;i++){
      res*=(n-i)%m;
      res%=m;
      res*=mod_inverse(i+1);
      res%=m;
    }
    return res;
  }

  ll mod_mult(ll a, ll b,ll m) {
    ll res = 0;
    ll exm = a % m;
    while (b) {
      if (b & 1) {
        res += exm;
        if (res > m) res -= m;
      }
      exm <<= 1;
      if (exm > m) exm -= m;
      b >>= 1;
    }
    return res;
  }

  ll mod_exm(ll a, ll b,ll m) {
    ll res = 1;
    ll exm = a % m;
    while (b) {
      if (b & 1) res = mod_mult(res, exm,m);
      exm = mod_mult(exm, exm,m);
      b >>= 1;
    }
    return res;
  }

  map<ll,ll> moebius(ll n){
    map<ll,ll>res;
    vector<ll>prime;
    for( int i=2; i*i<=n ;i++){
      if(n%i==0){
        prime.push_back(i);
        while(n%i==0)n/=i;
      }
    }
    if(n!=1)prime.push_back(n);
    int m=prime.size();
    for(int i=0;i<(1<<m);i++){
      int mu=1,d=1;
      for(int j=0;j<m;j++){
        mu*=-1;
        d*=prime[j];
      }
      res[d]=mu;
    }
    return res;
  }

  // 確率的高速素数判定　
  bool miller_rabin(ll n, ll times=10) {
    if (n < 2) return false;
    if (n == 2) return true;
    if (!(n & 1)) return false;
    ll q = n-1;
    int k = 0;
    while (q % 2 == 0) {
      k++;
      q >>= 1;
    }
    for (int i = 0; i < times; i++) {
      ll a = rand() % (n-1) + 1;
      ll x = mod_exm(a, q, n);
      if (x == 1) continue;
      bool found = false;
      for (int j = 0; j < k; j++) {
        if (x == n-1) {
          found = true;
          break;
        }
        x = mod_mult(x, x, n);
      }
      if (found) continue;
      return false;
    }
    return true;
  }

  ll pollard_rho(ll n, int c) {
    ll x = 2;
    ll y = 2;
    ll d = 1;
    while (d == 1) {
      x = mod_mult(x, x, n) + c;
      y = mod_mult(y, y, n) + c;
      y = mod_mult(y, y, n) + c;
      d = __gcd((x-y >= 0 ? x-y : y-x), n);
    }
    if (d == n) return pollard_rho(n, c+1);
    return d;
  }
  ll GCD(ll a,ll b){
    if((a%b)==0)return b;
    return GCD(b,a%b);
  }
  ll LCM(ll a,ll b){
    return a*b/GCD(a,b);
  }
  ll montmort(ll k){  // 完全順列 撹乱順列 indexが全部違う順列
    if( k == 0 ) return 1;
    if( k == 1 ) return 0;
    if( k == 2 ) return 1;
    ll i = 2;
    ll a = 0 , b = 1;
    while( i < k ){
      ll t = ( i * ( ( a + b ) % m ) ) % m;
      a = b; b = t; i++;
    }
    return b;
  }
  vector<ll> monmort_dp(ll k){
    vector<ll> dp(200009);
    dp[0] = 1;
    dp[1] = 0;
    dp[2] = 1;
    for(int i=3;i<200009;i++){
      dp[i] = ( i * ( ( dp[i-1] + dp[i-2] ) % m ) ) %m;
    }
    return dp;
  }
  ll nHr(ll n,ll k){ // 重複組合せ
    return stupid_combination(n+k-1,k);
  }
};

signed main(){
  NT N(1000000009);
  long long n;
  cin>>n;
  vector<long long>v=N.mrime_decommosition(n);
  set<long long>s;
  r(i,v.size()){
    s.insert(v[i]);
  }
  vector<long long>V=N.divisor(n);
  cout<<s.size()<<' '<<V.size()-1<<endl;
}
accuracy: 1
time_ms: 10
memory_kb: 6624
final_rank: 14

code_snippet: #include<iostream>
#include<vector>
#include<map>
using namespace std;

#define int long long

vector<int> ans_max(int n){
    vector<int> res;
    for(int i = 1; i * i <= n; ++i){
        if(n % i != 0) continue;
        res.push_back(i);
        if(n/i == i) continue;
        res.push_back(n/i);
    }
    return res;
}

map<int, int> ans_min(int n){
    map<int, int> res;
    if(n == 1){
        res[n] = 1;
        return res;
    }
    for(int i = 2, _n = n; i*i <= _n; i++){
        while(n % i == 0) {
            ++res[i];
            n /= i;
        }
    }

    if(n != 1) res[n] = 1;
    return res;
}

signed main(){

    int n; cin >> n;
    cout << ans_min(n).size() << " " << ans_max(n).size() - 1 <<  endl;
    return 0;
}
accuracy: 1
time_ms: 10
memory_kb: 3164
final_rank: 5

code_snippet: #include <bits/stdc++.h>
using namespace std;
int mnans=0;
int mxans=0;
const double eps=1e-9;
typedef vector<int> vi;
typedef long long ll;
ll n;
set<ll> st1;
set<ll> st2;

int main(void)
{
  ll mx=0;
  cin >> n;
  st1.insert(1);
  for(ll i=2;i*i<=n;i++)
    {
      if(n%i==0)
	{
	  st1.insert(n/i);
	  st1.insert(i);
	}
    }
  for(auto it=st1.begin();it!=st1.end();it++)
    {
      //cout << *it << endl;
      ll tmp=*it;
      mx=max(mx,tmp);
      mxans++;
    }
  mnans++;
  while(1)
    {
      for(ll j=1;j*j<=mx;j++)
	{
	  if(mx%j==0)
	    {
	      st2.insert(j);
	      st2.insert(mx/j);
	    }
	}
      /*for(auto it=st2.begin();it!=st2.end();it++)
	{
	  cout << *it << endl;
	  }*/
      mx=0;
      for(auto it=st1.begin();it!=st1.end();it++)
	{
	  ll tmp=*it;
	  auto check=st2.find(tmp);
	  if(check==st2.end())
	    {
	      mx=max(mx,tmp);
	    }
	}
      if(mx==0) break;
      else mnans++;
    }
  cout << mnans << ' ' << mxans << endl;
  return 0;
}
accuracy: 1
time_ms: 10
memory_kb: 3088
final_rank: 2

code_snippet: #include <bits/stdc++.h>
#define chmin(a, b) ((a)=min((a), (b)))
#define chmax(a, b) ((a)=max((a), (b)))
#define fs first
#define sc second
#define eb emplace_back
using namespace std;

typedef long long ll;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;

const ll MOD=1e9+7;
const ll INF=1e18;
const double pi=acos(-1);
const double eps=1e-10;

int dx[]={1, -1, 0, 0};
int dy[]={0, 0, 1, -1};

int main(){
    ll n; cin>>n;
    int cnt_prime_factor=0;
    int cnt_divisor=-1;

    for(int i=1; i<=sqrt(n); i++){
        if(n%i==0){
            if(n/i==i) cnt_divisor++;
            else cnt_divisor+=2;
        }
    }

    ll num=n;
    for(int i=2; i<=sqrt(n); i++){
        bool first=true;
        while(num%i==0){
            if(first){
                first=false;
                cnt_prime_factor++;
            }
            num/=i;
        }
    }

    if(num!=1) cnt_prime_factor++;

    cout << cnt_prime_factor << " " << cnt_divisor << endl;
}
accuracy: 1
time_ms: 10
memory_kb: 3064
final_rank: 1