We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
package main.java.com.poogle.BOJ.Q11047; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int k = sc.nextInt(); int[] cost = new int[n]; for (int i = 0; i < n; i++) { cost[i] = sc.nextInt(); } int answer = 0; for (int i = n - 1; i >= 0; i--) { if (cost[i] <= k) { int cnt = k / cost[i]; answer += cnt; k -= cost[i] * cnt; } } System.out.println(answer); } }
The text was updated successfully, but these errors were encountered:
e34de1d
suhyunsim
No branches or pull requests
문제
핵심 아이디어
증명: 동전 개수를 최소화 하려면 500원 동전을 최대한 많이 써야 한다?
어려운 점, 실수
풀이
The text was updated successfully, but these errors were encountered: