일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 |
Tags
- python3
- DP
- 합 구하기
- 소수찾기
- 브루투포스
- mvc
- Java
- 완전탐색
- Python
- BFS
- popleft
- 1일1솔
- JPA
- pypy3
- 프로그래머스
- 우선순위큐
- 소수판별
- 누적합
- 연관관계
- spring
- appendleft
- deque
- LCM
- 그리디 알고리즘
- c#
- 백준
- C#강의
- 파이썬
- 인프런
- unity
Archives
- Today
- Total
목록Math (1)
jae_coding

문제 문제 링크 문제 접근 최대 공약수를 구한다. 최대 공약수의 약수들을 오름차순으로 나열 import math를 이용하면 쉽게 해결 가능 math.gcd (최대 공약수) 코드 import sys import math input = sys.stdin.readline n = int(input()) n_list = list(map(int, input().split())) # greatest common factor gcf = math.gcd(*n_list) for i in range(1, gcf+1): if gcf % i == 0: print(i)
알고리즘 문제/수학(math)
2022. 7. 27. 21:41