관리 메뉴

솜씨좋은장씨

[BaekJoon] 21300번 : Bottle Return (Python) 본문

Programming/코딩 1일 1문제

[BaekJoon] 21300번 : Bottle Return (Python)

솜씨좋은장씨 2022. 5. 27. 20:20
728x90
반응형

코딩 1일 1문제! 오늘의 문제는 백준의 Bottle Return 입니다.

 

21300번: Bottle Return

In the United States, beverage container deposit laws, or so-called bottle bills, are designed to reduce litter and reclaim bottles, cans and other containers for recycling. Ten states currently have some sort of deposit-refund systems in place for differe

www.acmicpc.net

👨🏻‍💻 코드 ( Solution )

def caculate_money(bottle_num, fee):
    return bottle_num * fee

def bottle_return(bottle_list, fee_list):
    deposit_list = [(bottle_num * fee) for bottle_num, fee in zip(bottle_list, fee_list)]
    
    return sum(deposit_list)


if __name__ == "__main__":
    bottle_list = list(map(int, input().split()))
    
    fee_list = [5] * len(bottle_list)
    
    total_deposit = bottle_return(bottle_list, fee_list)
    
    print(total_deposit)
 

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

728x90
반응형
0 Comments
댓글쓰기 폼