Polynomials

  • + 0 comments

    My compact solution, easily a one-liner when ignoring the import statement…

    import numpy as np
    
    print(np.polyval(np.loadtxt([input()], float), int(input())))
    

    I see others cast x as float. It worked fine for me as int. Go figure!