본문 바로가기
Beakjoon&프로그래머스/파이썬

[백준/파이썬] 17466번 N! mod P (1)

by 현장 2022. 7. 12.

-Code

n, p = map(int, input().split())
res = 1
for i in range(2, n + 1):
    res = res * i % p
print(res % p)