일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |
Tags
- popleft
- Python
- 누적합
- c#
- pypy3
- 브루투포스
- BFS
- 프로그래머스
- mvc
- 우선순위큐
- 합 구하기
- DP
- 소수판별
- spring
- 백준
- 인프런
- 완전탐색
- 1일1솔
- deque
- python3
- LCM
- appendleft
- 그리디 알고리즘
- 소수찾기
- C#강의
- JPA
- 연관관계
- 파이썬
- Java
- 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