import java.util.Scanner; import java.math.*; public class Main{ final static int MAXN = 10010; final static int MAXV = 4; static int[] value = new int [MAXV]; static int[] vol = new int [MAXV]; static int[] dp = new int [MAXN];[color=red]//Syntax error on token ";", { expected after this token[/color] value[1]=vol[1]=150; value[2]=vol[2]=200; value[3]=vol[3]=350; public static void main(String[] args){[color=red]//Syntax error on token ")", ; expected[/color] Scanner in = new Scanner(System.in); while (in.hasNextInt()) { int t = in.nextInt(); while ((t--) > 0) { int n = in.nextInt(); for (int i = 0; i <= n; i++) { dp[i] = 0; } for (int i = 1; i <= MAXV-1; i++) { for (int j = vol[i]; j <= n;j++) { dp[j] = Math.max(dp[j], dp[j-vol[i]]+value[i]); } } System.out.println(n-dp[n]); } } }
//Syntax error, insert "}" to complete ClassBody
相关分类