algorithm

This documentation is automatically generated by online-judge-tools/verification-helper

View the Project on GitHub satashun/algorithm

:warning: cpp_src/number_theory/EnumQuotient.hpp

Code

V<pair<ll, ll>> enum_quotient(ll N) {
    V<pair<ll, ll>> res;
    ll l = 1;
    while (l <= N) {
        ll r = N / (N / l) + 1;
        //[l, r)
        res.emplace_back(l, r);
        l = r;
    }
    // zero interval
    res.emplace_back(N + 1, N + 2);
    return res;
}
#line 1 "cpp_src/number_theory/EnumQuotient.hpp"
V<pair<ll, ll>> enum_quotient(ll N) {
    V<pair<ll, ll>> res;
    ll l = 1;
    while (l <= N) {
        ll r = N / (N / l) + 1;
        //[l, r)
        res.emplace_back(l, r);
        l = r;
    }
    // zero interval
    res.emplace_back(N + 1, N + 2);
    return res;
}
Back to top page