PS/Baekjoon Online Judge
[백준 26350] Good Coin Denomination [Python]
kimyoungrok
2023. 9. 2. 14:44
728x90
풀이
화폐의 단위에 대해 화폐 간 최소 두배 이상일 때 "Good coin denominations!", 그렇지 않을 때 "Bad coin denominations!"를 출력해주면 되는 문제다.
두배 이상이 아닐 때 까지 loop를 돌며 비교를 하고, 만약 모든 화폐가 두배 이상이라는 조건을 만족한지 아닌지에 따라 알맞는 문구를 출력해주자.
소스코드
출처
26350번: Good Coin Denomination
Different countries use different coin denominations. For example, the USA uses 1, 5, 10, and 25. A desirable property of coin denominations is to have each coin at least twice the amount of its previous coin in sorted order. For example, the USA denominat
www.acmicpc.net
728x90