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/fps/fps_normalize_fn.py

Required by

Verified with

Code

import cp_library.math.fps.__header__

def fps_normalize(P: list, deg) -> list:
    if (N:=len(P)) < deg: P[N:] = [0]*(deg-N)
    del P[deg:]
    return P
'''
╺━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╸
             https://kobejean.github.io/cp-library               
'''

def fps_normalize(P: list, deg) -> list:
    if (N:=len(P)) < deg: P[N:] = [0]*(deg-N)
    del P[deg:]
    return P
Back to top page