Problem:
Problem J:
No Story
Since I got tired to write long problem statements, I decided to make this problem statement short. For given positive integer
L
, how many pairs of positive integers
a
,
b
(
a
≤
b
) such that LCM(
a
,
b
) =
L
are there? Here, LCM(
a
,
b
) stands for the least common multiple of
a
and
b
.
Input
For each dataset, an integer
L
is given in a line. Input terminates when
L
= 0.
Output
For each dataset, output the number of pairs of
a
and
b
.
Constraints
1 ≤
L
≤ 10
12
Sample Input
12
9
2
0
Output for the Sample Input
8
3
2

Submitted solutions:

code_snippet: #include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <vector>
using namespace std;
long long s;
int main()
{
	while(cin>>s&&s)
	{
		vector<int> a;
		for(int i=2;i<=s/i;i++)
		{
			int z=0;
			while(s%i==0)
				z++,s/=i;
			if(z)a.push_back(z);
		}
		if(s!=1)a.push_back(1);
		long long da=1;
		for(int i=0;i<a.size();i++)
		{
			da*=2*(a[i]+1)-1;
		}
		da++;
		da/=2;
		cout<<da<<endl;
	}
}
accuracy: 1
time_ms: 110
memory_kb: 3440
final_rank: 6

code_snippet: #include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <vector>
using namespace std;
long long s;
int main()
{
	while(cin>>s&&s)
	{
		vector<int> a;
		for(int i=2;i<=s/i;i++)
		{
			int z=0;
			while(s%i==0)
				z++,s/=i;
			if(z)a.push_back(z);
		}
		if(s!=1)a.push_back(1);
		long long da=1;
		for(int i=0;i<a.size();i++)
		{
			da*=2*(a[i]+1)-1;
		}
		da++;
		da/=2;
		cout<<da<<endl;
	}
}
accuracy: 1
time_ms: 110
memory_kb: 3056
final_rank: 5

code_snippet: #line 2 "cp-library/src/cp-template.hpp"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using uint = unsigned int;
using ull  = unsigned long long;
using i32 = int;
using u32 = unsigned int;
using i64 = long long;
using u64 = unsigned long long;
using i128 = __int128_t;
template < class T > bool chmin(T& a, T b) { if(a > b) { a = b; return true; } return false; }
template < class T > bool chmax(T& a, T b) { if(a < b) { a = b; return true; } return false; }
template < class T, class U > T ceil (T x, U y) { return (x > 0 ? (x + y - 1) / y :           x / y); }
template < class T, class U > T floor(T x, U y) { return (x > 0 ?           x / y : (x - y + 1) / y); }
int popcnt(i32 x) { return __builtin_popcount(x); }
int popcnt(u32 x) { return __builtin_popcount(x); }
int popcnt(i64 x) { return __builtin_popcountll(x); }
int popcnt(u64 x) { return __builtin_popcountll(x); }

#line 2 "cp-library/src/utility/rep_itr.hpp"
template < class T > struct itr_rep {
    T i, d;
    constexpr itr_rep(const T i) noexcept : i(i), d(1) {}
    constexpr itr_rep(const T i, const T d) noexcept : i(i), d(d) {}
    void operator++() noexcept { i += d; }
    constexpr int operator*() const noexcept { return i; }
    constexpr bool operator!=(const itr_rep x) const noexcept { return d > 0 ? i < x.i : i > x.i; }
};

template < class T > struct rep {
    const itr_rep< T > s, t;
    constexpr rep(const T t) noexcept : s(0), t(t) {}
    constexpr rep(const T s, const T t) noexcept : s(s), t(t) {}
    constexpr rep(const T s, const T t, const T d) noexcept : s(s, d), t(t, d) {}
    constexpr auto begin() const noexcept { return s; }
    constexpr auto end  () const noexcept { return t; }
};

template < class T > struct revrep {
    const itr_rep < T > s, t;
    constexpr revrep(const T t) noexcept : s(t - 1, -1), t(-1, -1) {}
    constexpr revrep(const T s, const T t) noexcept : s(t - 1, -1), t(s - 1, -1) {}
    constexpr revrep(const T s, const T t, const T d) noexcept : s(t - 1, -d), t(s - 1, -d) {}
    constexpr auto begin() const noexcept { return s; }
    constexpr auto end  () const noexcept { return t; }
};
#line 3 "cp-library/src/utility/io.hpp"

/* 128bit integer */
istream& operator>>(istream& is, i128& x) {
    std::string s; is >> s;
    int pm = (s[0] == '-');
    x = 0;
    for(int i : rep(pm, int(s.size()))) x = x * 10 + (s[i] - '0');
    if(pm) x *= -1;
    return is;
}
ostream& operator<<(ostream& os, const i128& x) {
    if(x == 0) return os << '0';
    i128 y = x;
    if(y < 0) { os << '-'; y *= -1; }
    std::vector<int> ny;
    while(y > 0) { ny.push_back(y % 10); y /= 10; }
    for(int i : revrep(ny.size())) os << ny[i];
    return os;
}

template < class S, class T > istream& operator>>(istream& is,       std::pair< S, T >& x) { is >> x.first        >> x.second; return is; }
template < class S, class T > ostream& operator<<(ostream& os, const std::pair< S, T >& x) { os << x.first << " " << x.second; return os; }

namespace scanner {
    struct sca {
        template < class T > operator T() {
            T s; std::cin >> s; return s;
        }
    };
    struct vec {
        int n;
        vec(int n) : n(n) {}
        template < class T > operator std::vector< T >() {
            std::vector< T > v(n);
            for(T& x : v) std::cin >> x;
            return v;
        }
    };
    struct mat {
        int h, w;
        mat(int h, int w) : h(h), w(w) {}
        template < class T > operator std::vector< std::vector< T > >() {
            std::vector m(h, std::vector< T >(w));
            for(std::vector< T >& v : m) for(T& x : v) std::cin >> x;
            return m;
        }
    };
    struct speedup {
        speedup() {
            std::cin.tie(0);
            std::ios::sync_with_stdio(0);
        }
    } speedup_instance;
}
scanner::sca in() { return scanner::sca(); }
scanner::vec in(int n) { return scanner::vec(n); }
scanner::mat in(int h, int w) { return scanner::mat(h, w); }

namespace printer {
    void precision(int d) { std::cout << std::fixed << std::setprecision(d); }
    void flush() { std::cout.flush(); }
}

template < class T >
ostream& operator<<(ostream& os, const std::vector< T > a) {
    int n = a.size();
    for(int i : rep(n)) { os << a[i]; if(i != n - 1) os << ' '; }
    return os;
}

int print() { std::cout << '\n'; return 0; }
template < class head, class... tail > int print(head&& h, tail&&... t) {
    std::cout << h; if(sizeof...(tail)) std::cout << ' ';
    return print(std::forward<tail>(t)...);
}
template < class T > int print_n(const std::vector< T > a) {
    int n = a.size();
    for(int i : rep(n)) std::cout << a[i] << "\n";
    return 0;
}


#line 2 "cp-library/src/utility/key_val.hpp"

template < class K, class V >
struct key_val {
    K key; V val;
    key_val() {}
    key_val(K key, V val) : key(key), val(val) {}
    template < std::size_t Index >
    std::tuple_element_t< Index, key_val >& get() {
        if constexpr (Index == 0) return key;
        if constexpr (Index == 1) return val;
    }
};

namespace std {

template < class K, class V > struct tuple_size < key_val< K, V > > : integral_constant< size_t, 2 > {};
template < class K, class V > struct tuple_element < 0, key_val< K, V > > { using type = K; };
template < class K, class V > struct tuple_element < 1, key_val< K, V > > { using type = V; };

}
#line 2 "cp-library/src/utility/vec_op.hpp"
template < class T > key_val< int, T > max_of(const vector< T >& a) {
    int i = std::max_element(a.begin(), a.end()) - a.begin();
    return {i, a[i]};
}
template < class T > key_val< int, T > min_of(const vector< T >& a) {
    int i = std::min_element(a.begin(), a.end()) - a.begin();
    return {i, a[i]};
}
template < class S, class T > S sum_of(const vector< T >& a) {
    S sum = 0;
    for(const T x : a) sum += x;
    return sum;
}
template < class S, class T > vector< S > freq_of(const vector< T >& a, T L, T R) {
    vector< S > res(R - L, S(0));
    for(const T x : a) res[x - L] += 1;
    return res;
}
template < class S, class T > struct prefix_sum {
    vector< S > s;
    prefix_sum(const vector< T >& a) : s(a) {
        s.insert(s.begin(), S(0));
        for(int i : rep(a.size())) s[i + 1] += s[i];
    }
    // [L, R)
    S sum(int L, int R) { return s[R] - s[L]; }
};
#line 3 "cp-library/src/utility/heap.hpp"

template < class T > using heap_min = std::priority_queue< T, std::vector< T >, std::greater< T > >;
template < class T > using heap_max = std::priority_queue< T, std::vector< T >, std::less< T > >;

#line 27 "cp-library/src/cp-template.hpp"

#line 1 "cp-library/src/algorithm/bin_search.hpp"
template < class T, class F >
T bin_search(T ok, T ng, F f) {
    while(abs(ng - ok) > 1) {
        T mid = (ok + ng) / 2;
        (f(mid) ? ok : ng) = mid;
    }
    return ok;
}

template < class T, class F >
T bin_search_real(T ok, T ng, F f, int step = 80) {
    while(step--) {
        T mid = (ok + ng) / 2;
        (f(mid) ? ok : ng) = mid;
    }
    return ok;
}
#line 2 "cp-library/src/algorithm/argsort.hpp"

template < class T > std::vector< int > argsort(const std::vector< T > &a) {
    std::vector< int > ids((int)a.size());
    std::iota(ids.begin(), ids.end(), 0);
    std::sort(ids.begin(), ids.end(), [&](int i, int j) {
        return a[i] < a[j] || (a[i] == a[j] && i < j);
    });
    return ids;
}
#line 1 "macro.hpp"
namespace macro {

using size_type = int;
template < class container > void  sort(container& a) { std::sort(std:: begin(a), std:: end(a)); }
template < class container > void rsort(container& a) { std::sort(std::rbegin(a), std::rend(a)); }
template < class container > void reverse(container& a) { std::reverse(std::begin(a), std::end(a)); }
template < class container > void unique(container& a) {
    std::sort(std::begin(a), std::end(a));
    a.erase(std::unique(std::begin(a), std::end(a)), std::end(a));
}
template < class container > container  sorted(const container& a) { container b = a;  sort(b); return std::move(b); }
template < class container > container rsorted(const container& a) { container b = a; rsort(b); return std::move(b); }
template < class container, class compare > void sort(container& a, const compare& cmp) { std::sort(std::begin(a), std::end(a), cmp); }
template < class container, class compare > container sorted(const container& a, const compare& cmp) { container b = a; sort(b, cmp); return std::move(b); }
template < class container, class value > size_type lower_bound(const container& a, const value& x) { return std::lower_bound(std::begin(a), std::end(a), x) - std::begin(a); }
template < class container, class value > size_type upper_bound(const container& a, const value& x) { return std::upper_bound(std::begin(a), std::end(a), x) - std::begin(a); }

const std::vector<std::pair<size_type, size_type>> dir4 = { {+1,  0}, {-1,  0}, { 0, +1}, { 0, -1} };
const std::vector<std::pair<size_type, size_type>> dir8 = { {-1, -1}, {-1,  0}, {-1, +1}, { 0, -1}, { 0, +1}, {+1, -1}, {+1,  0}, {+1, +1} };

#ifdef _DEBUG
#define debug(x) std::cout << "[" << __LINE__ << "] " << #x << ": " << x << std::endl
#else
#define debug(x)
#endif

template < class container > void concat(container& a, const container& b) {
    a.insert(std::end(a), std::begin(b), std::end(b));
}
std::vector<size_type> iota(const size_type n) {
    std::vector<size_type> I(n);
    std::iota(std::begin(I), std::end(I), 0);
    return I;
}
template < class container > std::vector<size_type> sort_idx(const container& a) {
    const size_type n = a.size();
    std::vector<size_type> I = iota(n);
    std::sort(std::begin(I), std::end(I), [&](size_type i, size_type j) { return a[i] < a[j] or (a[i] == a[j] and i < j); });
    return I;
}
template < class container, class compare > std::vector<size_type> sort_idx(const container& a, const compare& cmp) {
    const size_type n = a.size();
    std::vector<size_type> I = iota(n);
    std::sort(std::begin(I), std::end(I), [&](size_type i, size_type j) { return cmp(a[i], a[j]) or (a[i] == a[j] and i < j); });
    return std::move(I);
}

struct grid {
    using size_type = int;
    size_type H, W;
    grid(const size_type H, const size_type W) : H(H), W(W) {}
    bool contains(const size_type i, const size_type j) {
        return 0 <= i and i < H and 0 <= j and j < W;
    }
};

using f64 = long double;

template < class T > vector< T >& operator++(vector< T >& a) { for(T& x : a) x++; return a; }
template < class T > vector< T >& operator--(vector< T >& a) { for(T& x : a) x--; return a; }
template < class T > vector< T >  operator++(vector< T >& a, signed) { vector< T > res = a; for(T& x : a) x++; return res; }
template < class T > vector< T >  operator--(vector< T >& a, signed) { vector< T > res = a; for(T& x : a) x--; return res; }

} // namespace macro

using namespace macro;
#line 3 "A.cpp"

int main() {
    while(true) {
        i64 L = in();
        if(L == 0) return 0;

        i64 ans = 1;
        const i64 N = L;
        for(i64 x = 2; x * x <= N; x++) {
            i64 cnt = 0;
            while(L % x == 0) { L /= x; cnt += 1; }
            ans *= cnt * 2 + 1;
        }
        
        if(L != 1) ans *= 1 * 2 + 1;
        print((ans + 1) / 2);
    }
}
accuracy: 1
time_ms: 610
memory_kb: 3156
final_rank: 7

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

class Number {
  private:
    long long num;

  public:
    Number(long long x = 0) { num = x; }
    // 素数判定
    // O(√N)で判定
    bool is_prime() {
        if (num == 1) {
            return false;
        }
        for (long long i = 2; i * i <= num; i++) {
            if (num % i == 0) {
                return false;
            }
        }
        return true;
    }
    // 約数列挙
    // O(√N)で列挙
    vector<long long> divisor() {
        vector<long long> res;
        for (long long i = 1; i * i <= num; i++) {
            if (num % i == 0) {
                res.push_back(i);
                if (i * i != num) {
                    res.push_back(num / i);
                }
            }
        }
        sort(res.begin(), res.end());
        return res;
    }
    // 素因数分解
    // O(√N)で列挙
    vector<pair<long long, long long>> prime_factor() {
        vector<pair<long long, long long>> res;
        for (long long i = 2; i * i <= num; i++) {
            if (num % i != 0) {
                continue;
            }
            long long tmp = 0;
            while (num % i == 0) {
                tmp++;
                num /= i;
            }
            res.push_back({i, tmp});
        }
        if (num != 1) {
            res.push_back({num, 1});
        }
        return res;
    }
};

void solve() {
    long long l;
    cin >> l;
    if (l == 0) {
        exit(0);
    }
    auto vec = Number(l).divisor();
    int ans = 0;
    for (int i = 0; i < vec.size(); i++) {
        for (int j = i; j < vec.size(); j++) {
            if (lcm(vec[i], vec[j]) == l) {
                ans++;
            }
        }
    }
    cout << ans << endl;
}

int main() {
    while (1) {
        solve();
    }
    return 0;
}
accuracy: 1
time_ms: 770
memory_kb: 3384
final_rank: 10

code_snippet: #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define all(a) a.begin(),a.end()
#define reps(i, a, n) for (int i = (a); i < (int)(n); i++)
#define rep(i, n) reps(i, 0, n)
#define rreps(i, a, n) for (int i = (a); i > (int)(n); i--)
const long long mod = 1000000007;

ll n;

vector<pair<ll,ll>> pf(ll N) {
    vector<pair<ll,ll>> res;
    for (ll a = 2; a * a <= N; ++a) {
        if (N % a != 0) continue;
        ll ex = 0;

        while (N % a == 0) {
            ++ex;
            N /= a;
        }

        res.push_back({a, ex});
    }

    if (N != 1) res.push_back({N, 1});
    return res;
}

vector<ll> divisors(ll N) {
    vector<ll> res;
    for (ll i = 1; i * i <= N; ++i) {
        if (N % i == 0) {
            res.push_back(i);
            if (N/i != i) res.push_back(N/i);
        }
    }
    sort(res.begin(), res.end());
    return res;
}


void solve() {
  vector<pair<ll,ll>> v = pf(n);
  vector<ll> rr = divisors(n);
  ll ans= 0;
  rep(i,rr.size()) {
    int now = 1;
    rep(j,v.size()) {
      if (rr[i]%(ll)(pow(v[j].first,v[j].second)) == 0) {
        now *= v[j].second+1;
      }
    }
    ans += now;
  }
  cout << (ans-1)/2 + 1 << endl;
  return;
}

int main() {
  while (true) {
    cin >> n;
    if (n == 0) {
      return 0;
    }
    solve();
  }
}
accuracy: 1
time_ms: 650
memory_kb: 3836
final_rank: 19

code_snippet: // (⁠◕⁠ᴗ⁠◕⁠✿⁠)

#include <bits/stdc++.h>
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define srep(i, s, n) for (ll i = s; i < (n); i++)
#define len(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
using namespace std;
template<typename T> using vc = vector<T>;
template<typename T> using vv = vc<vc<T>>;
template<typename T> using vvv = vv<vc<T>>;
using vi = vc<int>;using vvi = vv<int>; using vvvi = vv<vi>;
using ll = long long;using vl = vc<ll>;using vvl = vv<ll>; using vvvl = vv<vl>;
using ld = long double; using vld = vc<ld>; using vvld = vc<vld>; using vvvld = vc<vvld>;
using uint = unsigned int;
using ull = unsigned long long;
const ld pi = acos(-1.0);
const int inf = 0x3f3f3f3f;
const ll INF = 0x3f3f3f3f3f3f3f3f;
// const ll mod = 1000000007;
const ll mod = 998244353;
inline bool inside(ll y, ll x, ll H, ll W) {return 0 <= (y) and (y) < (H) and 0 <= (x) and (x) < (W); }

#define debug(var)  do{std::cout << #var << " : \n";view(var);}while(0)
template<typename T> void view(T e){cout << e << endl;}
template<typename T> void view(const vc<T>& v){for(const auto& e : v){ cout << e << " "; } cout << endl;}
template<typename T> void view(const vv<T>& vv){ for(const auto& v : vv){ view(v); } }

vc<pair<ll, ll>> factorization(ll &N){
    vc<pair<ll, ll>> factors;
    ll tmp = N;
    for (ll i = 2; i * i <= N + 1; i++){
        if (tmp % i == 0){
            int cnt = 0;
            while (tmp % i == 0){
                tmp /= i;
                cnt += 1;
            }
            factors.push_back({i, cnt});
        }
    }
    if (tmp != 1){
        factors.push_back({tmp, 1});
    }
    if (len(factors) == 0){
        factors.push_back({N, 1});
    }
    return factors;
}

ll solve(ll L){
    if (L == 1) return 1;
    auto factor = factorization(L);
    int N = len(factor);
    ll ans = 0;
    vl pw(16, 1); rep(i, 15) pw[i + 1] = pw[i] * 3;
    rep(cmb, pw[N]){ // 0 -> a, 1 -> b, 2 -> a & b
        ll a = 1, b = 1;
        rep(i, N){
            if (cmb / pw[i] % 3 == 0){
                b *= factor[i].second;
            }
            if (cmb / pw[i] % 3 == 1){
                a *= factor[i].second;
            }
        }
        ans += a * b;
    }
    ans++; // same case
    ans /= 2;
    return ans;
}

int main(){
    vl ans;
    while (true){
        ll L; cin >> L;
        if (L == 0) break;
        ans.push_back(solve(L));
    }
    for (auto x : ans) cout << x << endl;
}
accuracy: 1
time_ms: 600
memory_kb: 3560
final_rank: 8

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

int main(){
    ll n;
    while(cin >> n, n){
        vector<int> num;
        for(ll i = 2; i*i <= n; i++){
            int t = 0;
            while(n%i == 0) n /= i, t++;
            if(t)   num.push_back(t);
        }
        if(n != 1)  num.push_back(1);
        ll ans = 1;
        for(int t : num){
            ans *= 2*t+1;
        }
        cout << (ans+1)/2 << endl;
    }
    return 0;
}
accuracy: 1
time_ms: 70
memory_kb: 3100
final_rank: 4

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

using i64 = int64_t;

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

int main(){
    i64 l;
    while(cin >> l, l != 0){
        auto mp = prime_factor(l);
        i64 n = 1;
        for(auto e: mp){
            n *= 2*e.second + 1;
        }
        cout << (n+1) / 2 << endl;
    }

    return 0;
}
accuracy: 1
time_ms: 70
memory_kb: 2940
final_rank: 1

code_snippet: #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
const ll MOD = 1000000007;
const int IINF = INT_MAX;
const ll LLINF = LLONG_MAX;
const int MAX_N = int(2e5 + 5);
const double EPS = 1e-8;
const int di[] = {0, 1, 0, -1}, dj[] = {1, 0, -1, 0};
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define SORT(v) sort((v).begin(), (v).end())
#define ALL(v) (v).begin(), (v).end()


int main() {
    ll L, ans;
    while(cin >> L,L){
        ans = 1;
        for(ll i=2; i*i<=L; i++){
            if(L%i==0){
                ll cnt = 0;
                while(L%i==0){
                    L /= i;
                    cnt++;
                }
                ans *= 2*cnt+1;
            }
        }
        if(L!=1) ans *= 3;
        ans = (ans+1)/2;
        cout << ans << endl;
    }
    return 0;
}
accuracy: 1
time_ms: 70
memory_kb: 2988
final_rank: 2

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

typedef long long ll;

int main() {
    while (1) {
        ll L, ans = 1;
        cin >> L;
        if(L == 0) break;
        for (ll i = 2; i * i <= L; ++i) {
            ll cnt = 0;
            while (L % i == 0) {
                ++cnt;
                L /= i;
            }
            ans *= 2 * cnt + 1;
        }
        if (L != 1) {
            ans *= 3;
        }
        ans = (ans + 1) / 2;
        cout << ans << endl;
    }
    return 0;
}
accuracy: 1
time_ms: 80
memory_kb: 3080
final_rank: 3

code_snippet: #include <stdio.h>
#include <cmath>
#include <algorithm>
#include <cfloat>
#include <stack>
#include <queue>
#include <vector>
#include <string>
#include <iostream>
#include <set>
#include <map>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;

ll L;

ll calc(ll x,ll y){
	if(y == 0){
		return x;
	}else{
		return calc(y,x%y);
	}
}

void func(){

	if(L == 1){
		printf("1\n");
		return;
	}

	vector<ll> DIVISOR;

	for(ll i = 1; i <= sqrt(L); i++){
		if(L%i == 0){
			DIVISOR.push_back(i);
			if(i*i != L)DIVISOR.push_back(L/i);
		}
	}

	sort(DIVISOR.begin(),DIVISOR.end());

	ll small,big,common;

	int ans = 0;

	for(int i = 0; i < DIVISOR.size(); i++){
		for(int k = i; k < DIVISOR.size(); k++){
			small = DIVISOR[i];
			big = DIVISOR[k];

			common = calc(big,small);

			small /= common;
			big /= common;

			if(small*big*common == L)ans++;
		}
	}

	printf("%d\n",ans);
}

int main(){

	while(true){
		scanf("%lld",&L);
		if(L == 0)break;

		func();
	}

	return 0;
}
accuracy: 1
time_ms: 980
memory_kb: 3136
final_rank: 15

code_snippet: #include<bits/stdc++.h>
using namespace std;
  
#define REP(i,s,n) for(int i=s;i<n;++i)
#define rep(i,n) REP(i,0,n)
#define SORT(c) sort((c).begin(),(c).end())
#define IINF INT_MAX
#define LLINF LLONG_MAX
  
typedef long long ll;
typedef pair<int, int> ii;
 
#define DEBUG false
 
#define MAXI 1000001
 
vector<ll> prime;
 
int main(){
 
    ll l;
    bool used[MAXI] = {false};
    REP(i, 2, MAXI){
        if(!used[i]) prime.push_back(i);
        for(int j = 2; i * j < MAXI; j++) used[i*j] = true;
    }
     
    while(cin >> l, l){
        ll tmp = l;
        ll ans = 1;
        ll mul = 1;
        rep(i, prime.size()){
        	ll cnt = 0;
            while(tmp != 1 && tmp % prime[i] == 0) {
                cnt++;
                tmp /= prime[i];
            }
            mul *= (cnt * 2 + 1);
        }
        if(tmp >= MAXI) mul *= 3;
        ans += mul;
        cout << ans / 2 << endl;
    }
     
     
     
    return 0;
}
accuracy: 1
time_ms: 660
memory_kb: 4664
final_rank: 20

code_snippet: #include<iostream>
#include<cstdio>
#include<algorithm>
#include<queue>
#include<vector>
#include<string>
#include<functional>
#define int long long
using namespace std;

int gcd(int a, int b) {
	if (b == 0)return a;
	return gcd(b, a%b);
}
signed main() {
	int a;
	while(scanf("%lld", &a),a){
	vector<int>V;
	for (int b = 1; b*b <= a; b++) {
		if (a%b == 0) {
			V.push_back(b);
			if (b != a / b) {
				V.push_back(a / b);
			}
		}
	}
	sort(V.begin(), V.end());
	int sum = 0;
	for (int i = 0; i < V.size(); i++) {
		for (int j = i; j < V.size(); j++) {
			if (V[i] / gcd(V[i], V[j])*V[j] == a)sum++;
		}
	}
	printf("%lld\n", sum);}
}
accuracy: 1
time_ms: 950
memory_kb: 3236
final_rank: 17

code_snippet: #include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
using namespace std;
typedef long long ll;

ll gcd(ll a, ll b) { if (!b)return a; return gcd(b, a%b); }
ll lcm(ll a, ll b) { return a / gcd(a, b)*b; }
ll v[3000], len;
int main() {
	ll a;
	while (scanf("%lld", &a), a) {
		len = 0;
		for (ll i = 1; i*i <= a; i++) {
			if (a%i == 0) {
				v[len++] = i;
				if (i != a / i)v[len++] = a / i;
			}
		}
		sort(v, v + len);
		int cnt = 0;
		rep(i, len)for (int j = i; j < len; j++) {
			if (lcm(v[i], v[j]) == a)cnt++;
		}
		printf("%d\n", cnt);
	}
}
accuracy: 1
time_ms: 890
memory_kb: 3248
final_rank: 12

code_snippet: #include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
using namespace std;
typedef long long ll;

ll gcd(ll a, ll b) { if (!b)return a; return gcd(b, a%b); }
ll lcm(ll a, ll b) { return a / gcd(a, b)*b; }
int main() {
	ll a;
	while (scanf("%lld", &a), a) {
		vector<ll>v;
		for (ll i = 1; i*i <= a; i++) {
			if (a%i == 0) {
				v.push_back(i);
				if (i != a / i)v.push_back(a / i);
			}
		}
		if (v.size() > 3000)abort();
		sort(v.begin(), v.end());
		int cnt = 0;
		rep(i, v.size())for (int j = i; j < v.size(); j++) {
			if (lcm(v[i], v[j]) == a)cnt++;
		}
		printf("%d\n", cnt);
	}
}
accuracy: 1
time_ms: 950
memory_kb: 3260
final_rank: 18

code_snippet: #include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
using namespace std;
typedef long long ll;

ll gcd(ll a, ll b) { if (!b)return a; return gcd(b, a%b); }
ll lcm(ll a, ll b) { return a / gcd(a, b)*b; }
int main() {
	ll a;
	while (scanf("%lld", &a), a) {
		vector<ll>v;
		for (ll i = 1; i*i <= a; i++) {
			if (a%i == 0) {
				v.push_back(i);
				if (i != a / i)v.push_back(a / i);
			}
		}
		if (v.size() > 6000)abort();
		sort(v.begin(), v.end());
		int cnt = 0;
		rep(i, v.size())for (int j = i; j < v.size(); j++) {
			if (lcm(v[i], v[j]) == a)cnt++;
		}
		printf("%d\n", cnt);
	}
}
accuracy: 1
time_ms: 960
memory_kb: 3116
final_rank: 13

code_snippet: #include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
using namespace std;
typedef long long ll;

ll gcd(ll a, ll b) { if (!b)return a; return gcd(b, a%b); }
ll lcm(ll a, ll b) { return a / gcd(a, b)*b; }
int main() {
	ll a;
	while (scanf("%lld", &a), a) {
		vector<ll>v;
		for (ll i = 1; i*i <= a; i++) {
			if (a%i == 0) {
				v.push_back(i);
				if (i != a / i)v.push_back(a / i);
			}
		}
		if (v.size() > 10000)abort();
		sort(v.begin(), v.end());
		int cnt = 0;
		rep(i, v.size())for (int j = i; j < v.size(); j++) {
			if (lcm(v[i], v[j]) == a)cnt++;
		}
		printf("%d\n", cnt);
	}
}
accuracy: 1
time_ms: 950
memory_kb: 3188
final_rank: 14

code_snippet: #include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
using namespace std;
typedef long long ll;

ll gcd(ll a, ll b) { if (!b)return a; return gcd(b, a%b); }
ll lcm(ll a, ll b) { return a / gcd(a, b)*b; }
int main() {
	ll a;
	while (scanf("%lld", &a), a) {
		vector<ll>v;
		for (ll i = 1; i*i <= a; i++) {
			if (a%i == 0) {
				v.push_back(i);
				if (i != a / i)v.push_back(a / i);
			}
		}
		sort(v.begin(), v.end());
		int cnt = 0;
		rep(i, v.size())for (int j = i; j < v.size(); j++) {
			if (lcm(v[i], v[j]) == a)cnt++;
		}
		printf("%d\n", cnt);
	}
}
accuracy: 1
time_ms: 950
memory_kb: 3220
final_rank: 16

code_snippet: #include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
using namespace std;
typedef long long ll;

ll gcd(ll a, ll b) { if (a < b)swap(a, b); if (!b)return a; return gcd(b, a%b); }
ll lcm(ll a, ll b) { return a / gcd(a, b)*b; }
int main() {
	ll a;
	while (scanf("%lld", &a), a) {
		vector<ll>v;
		for (ll i = 1; i*i <= a; i++) {
			if (a%i == 0) {
				v.push_back(i);
				if (i != a / i)v.push_back(a / i);
			}
		}
		sort(v.begin(), v.end());
		int cnt = 0;
		rep(i, v.size())for (int j = i; j < v.size(); j++) {
			if (lcm(v[i], v[j]) == a)cnt++;
		}
		printf("%d\n", cnt);
	}
}
accuracy: 1
time_ms: 920
memory_kb: 3132
final_rank: 11

code_snippet: #include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

#define int long long
#define PB push_back

int gcd(int a, int b)
{
    int tmp;
    while (b) {
        tmp = a;
        a = b;
        b = tmp % b;
    }
    return a;
}

inline int lcm(int a, int b)
{
    return a / gcd(a, b) * b;
}

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

    int L;
    
    while (cin >> L, L) {
        vector<int> divisors;

        for (int i = 1; i * i <= L; ++i) {
            if (L % i == 0) {
                divisors.PB(i);
                if (i * i != L) divisors.PB(L / i);
            }
        }

        sort(begin(divisors), end(divisors));

        int ans = 0;

        for (int i = 0; i < (int)divisors.size(); ++i) {
            for (int j = 0; j <= i; ++j) {
                int ii = divisors[i], jj = divisors[j];

                if (lcm(ii, jj) == L) {
                    ans++;
                }
            }
        }

        cout << ans << endl;
    }
}
accuracy: 1
time_ms: 900
memory_kb: 3084
final_rank: 9