Notice
Recent Posts
Recent Comments
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- 데이콘
- Baekjoon
- programmers
- github
- 편스토랑
- leetcode
- 파이썬
- ubuntu
- 금융문자분석경진대회
- Kaggle
- 편스토랑 우승상품
- gs25
- 프로그래머스 파이썬
- 맥북
- dacon
- ChatGPT
- 코로나19
- PYTHON
- Git
- 백준
- 캐치카페
- 프로그래머스
- 우분투
- Docker
- hackerrank
- 자연어처리
- AI 경진대회
- Real or Not? NLP with Disaster Tweets
- SW Expert Academy
- 더현대서울 맛집
Archives
- Today
- Total
솜씨좋은장씨
[BaekJoon] 10707번 : 수도요금 (Python) 본문
728x90
반응형

코딩 1일 1문제! 오늘의 문제는 백준의 수도요금 입니다.
10707번: 수도요금
JOI군이 살고 있는 지역에는 X사와 Y사, 두 개의 수도회사가 있다. 두 회사의 수도요금은 한 달간 수도의 사용량에 따라 다음과 같이 정해진다. X사 : 1리터당 A엔. Y사 : 기본요금은 B엔이고, 사용량
www.acmicpc.net
👨🏻💻 코드 ( Solution )
def x_company(A, P):
return A * P
def y_company(B, C, D, P):
extra_p = P - C
extra_bill = 0
if extra_p > 0:
extra_bill = extra_p * D
y_company_bill = B + extra_bill
return y_company_bill
def water_bill(A, B, C, D, P):
x_company_bill = x_company(A, P)
y_company_bill = y_company(B, C, D, P)
return min(x_company_bill, y_company_bill)
if __name__ == "__main__":
A = int(input())
B = int(input())
C = int(input())
D = int(input())
P = int(input())
print(water_bill(A, B, C, D, P))
GitHub - SOMJANG/CODINGTEST_PRACTICE: 1일 1문제 since 2020.02.07
1일 1문제 since 2020.02.07. Contribute to SOMJANG/CODINGTEST_PRACTICE development by creating an account on GitHub.
github.com
'Programming > 코딩 1일 1문제' 카테고리의 다른 글
[BaekJoon] 5522번 : 카드 게임 (Python) (0) | 2022.04.11 |
---|---|
[BaekJoon] 10101번 : 삼각형 외우기 (Python) (0) | 2022.04.10 |
[BaekJoon] 20429번 : 세금 (Python) (0) | 2022.04.08 |
[BaekJoon] 16430번 : 제리와 톰 (Python) (0) | 2022.04.07 |
[BaekJoon] 17496번 : 스타후르츠 (Python) (0) | 2022.04.06 |