| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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
- c#
- C#강의
- 우선순위큐
- 인프런
- appendleft
- pypy3
- 완전탐색
- DP
- spring
- 1일1솔
- LCM
- Java
- JPA
- 소수판별
- 파이썬
- 백준
- 누적합
- deque
- 연관관계
- 프로그래머스
- 브루투포스
- python3
- 소수찾기
- mvc
- 합 구하기
- BFS
- popleft
- unity
- 그리디 알고리즘
- Python
Archives
- Today
- Total
목록14916 (1)
jae_coding
문제 문제 링크 코드 import sys input = sys.stdin.readline n = int(input()) temp = n flag = False count = 0 if int(n / 5) > 0: count += int(n / 5) n = n - 5 * int(n / 5) while n != 0: if n % 2 == 0: count += int(n / 2) n = n - 2 * int(n / 2) else: count -= 1 n += 5 if temp < n: flag = True if flag: print(-1) else: print(count)
알고리즘 문제/그리디 문제
2022. 7. 20. 12:17