해커랭크 문제. Extra Long Factorials
- 링크: https://www.hackerrank.com/challenges/extra-long-factorials/problem
- Author: vatsalchanana
- Difficulty: Medium
#!/bin/python3
import math
import os
import random
import re
import sys
# Complete the extraLongFactorials function below.
def extraLongFactorials(n):
total = 1
while n > 1:
total = total * n
n -= 1
print(total)
if __name__ == '__main__':
n = int(input())
extraLongFactorials(n)
'알고리즘' 카테고리의 다른 글
[알고리즘] 삽입정렬, 인서션 소트 (Insertion Sort) (0) | 2019.08.08 |
---|---|
[알고리즘] 선택정렬, 셀렉션소트 (Selection Sort) (0) | 2019.08.07 |
[알고리즘] 거품정렬, 버블 소트(Bubble sort) (0) | 2019.08.06 |
[알고리즘] Sherlock and Squares (0) | 2019.07.18 |
[알고리즘] 시간 복잡도, 공간 복잡도, 빅오(Big O) (0) | 2019.04.09 |
댓글