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
반응형
'Agorithm > 백준 알고리즘' 카테고리의 다른 글
| 백준 알고리즘 10214번 Baseball(python) (0) | 2021.02.19 |
|---|---|
| 백준 알고리즘 10262번 주사위 게임(python) (0) | 2021.02.19 |
| 백준 알고리즘 10395번 Automated Checking Machine(python) (0) | 2021.02.19 |
| 백준 알고리즘 10406번 The fellowship of the ring(python) (0) | 2021.02.19 |
| 백준 알고리즘 10409번 서버(python) (0) | 2021.02.19 |