Agorithm/백준 알고리즘
백준 알고리즘 10270번 Algebraic Teamwork(python)
kimjinho1
2021. 2. 19. 02:46
728x90
반응형
단순 수학 문제이다. Python3로 제출하니 시간초과가 떠서 PyPy3로 통과했다.
from sys import stdin
from math import factorial
for _ in range(int(stdin.readline())):
n = int(stdin.readline())
res = factorial(n)
print((res-1) % (10**9 + 7))
728x90
반응형