cp-library

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

View the Project on GitHub kobejean/cp-library

:warning: cp_library/math/table/divisors_cnts_cls.py

Code

import cp_library.math.table.__header__

class DivisorCounts(list[tuple[int,int]]):
    def __init__(D, N):
        super().__init__()
        k = 1
        while k <= N:
            D.append((d := N//k, -k + (k := N//d+1)))
        D.reverse()
'''
╺━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╸
             https://kobejean.github.io/cp-library               
'''

class DivisorCounts(list[tuple[int,int]]):
    def __init__(D, N):
        super().__init__()
        k = 1
        while k <= N:
            D.append((d := N//k, -k + (k := N//d+1)))
        D.reverse()
Back to top page