Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- 사칙연산
- 정렬
- Incognito
- Web Hacking
- xcz.kr
- 그리디 알고리즘
- MySQL
- Text
- 백준
- 써니나타스
- SuNiNaTas
- Web
- writeup
- Database
- 구현
- Forensics
- CTF
- Python
- misc
- HackCTF
- wargame
- 문자열
- Digital Forensics
- 인코그니토
- php
- cryptography
- 수학
- Network
- C
- N0Named
Archives
- Today
- Total
목록유클리드 정수론 (1)
보안을 그리다, 훈이
[Baekjoon/Python3] 5347번 LCM
[Baekjoon/Python3] 5347번 LCM www.acmicpc.net/problem/5347 5347번: LCM 첫째 줄에 테스트 케이스의 개수 n이 주어진다. 다음 n개 줄에는 a와 b가 주어진다. a와 b사이에는 공백이 하나 이상 있다. 두 수는 백만보다 작거나 같은 자연수이다. www.acmicpc.net def LCM(a, b): return (a * b) // GCD(a, b) def GCD(a, b): if b % a: return GCD(b % a, a) else: return a n = int(input()) for i in range(n): a, b = map(int, input().split()) print(LCM(a, b))
Programming/Python & Data Structures
2020. 12. 5. 21:05