일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- error
- Artificial Intelligence
- leetcode
- Linux
- Kaggle
- Anaconda
- memory bank
- sliding video q-former
- multimodal machine learning
- q-former
- quantification
- MySQL
- Server
- jmeter
- secure-file-priv
- ma-lmm
- 코딩테스트
- hackerrank
- LeNet-5
- long video understanding
- Github
- transference
- 용어
- tensorflow
- autogluon
- Python
- CNN
- timestamp-aware frame encoder
- 백준
- timechat
Archives
- Today
- Total
반응형
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- error
- Artificial Intelligence
- leetcode
- Linux
- Kaggle
- Anaconda
- memory bank
- sliding video q-former
- multimodal machine learning
- q-former
- quantification
- MySQL
- Server
- jmeter
- secure-file-priv
- ma-lmm
- 코딩테스트
- hackerrank
- LeNet-5
- long video understanding
- Github
- transference
- 용어
- tensorflow
- autogluon
- Python
- CNN
- timestamp-aware frame encoder
- 백준
- timechat
Archives
- Today
- Total
Juni_DEV
[Python, 백준] 2839번 : 설탕 배달 본문
반응형
https://www.acmicpc.net/problem/2839
2839번: 설탕 배달
상근이는 요즘 설탕공장에서 설탕을 배달하고 있다. 상근이는 지금 사탕가게에 설탕을 정확하게 N킬로그램을 배달해야 한다. 설탕공장에서 만드는 설탕은 봉지에 담겨져 있다. 봉지는 3킬로그
www.acmicpc.net

풀이.
n = int(input())
answer = []
count = 0
# 5의 배수인 경우 바로 값을 출력함
if n % 5 == 0 :
print(int(n/5))
else :
while(n > 0):
# 5씩 빼면서 3의 배수가 되는 경우를 answer 배열에 넣음
if n%3 == 0:
small = int(n/3)
big= count
answer.append(small + big)
n= n-5
count += 1
# 배열에 값이 없는 경우 배열에 -1 넣음
if not answer: answer.append(-1)
# 최솟값 출력
print(min(answer))

반응형
'Coding Interview' 카테고리의 다른 글
[Python, HackerRank] Mini-Max Sum (0) | 2023.04.13 |
---|---|
[Python, HackerRank] Time-conversion (0) | 2023.04.13 |
[Python, HackerRank] Plus Minus (2) | 2023.04.13 |
[Python, 프로그래머스] 단어 변환 (0) | 2021.06.25 |
[Python, 백준] 1149번 : RGB거리 (0) | 2021.06.24 |