CCF 201709-1 打酱油
此题可分三步贪心选择得到整体的最优解。上满分代码:
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int N = scanner.nextInt();
scanner.close();
int five = N/50;
int three = (N-50*five)/30;
int one = (N-50*five-30*three)/10;
int total = five*7+three*4+one;
System.out.print(total);
}
}