cp-library

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

View the Project on GitHub kobejean/cp-library

:heavy_check_mark: cp_library/math/table/pow_cls.py

Verified with

Code

import cp_library.math.table.__header__

class Pow(list[int]):
    def __init__(self,K,N,mod=None):
        super().__init__([1]*(N+1))
        if mod is None:
            for i in range(N):
                self[i+1] = self[i]*K
        else:
            for i in range(N):
                self[i+1] = self[i]*K % mod
'''
╺━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╸
             https://kobejean.github.io/cp-library               
'''

class Pow(list[int]):
    def __init__(self,K,N,mod=None):
        super().__init__([1]*(N+1))
        if mod is None:
            for i in range(N):
                self[i+1] = self[i]*K
        else:
            for i in range(N):
                self[i+1] = self[i]*K % mod
Back to top page