0_0_29603022_32294.cpp:1:1: error: 'import' does not name a type
import java.util.*;
^
0_0_29603022_32294.cpp:2:1: error: 'import' does not name a type
import java.io.*;
^
0_0_29603022_32294.cpp:7:5: error: expected unqualified-id before '[' token
int[] prices;
^
0_0_29603022_32294.cpp:8:5: error: expected unqualified-id before '[' token
int[] dp;
^
0_0_29603022_32294.cpp:9:13: error: expected ',' or '...' before 'prices'
Main(int[] prices, int m) {this.prices = prices; balance = m; N = prices.length; dp = new int[balance + 1];}
^
0_0_29603022_32294.cpp:26:9: error: expected ':' before 'static'
public static void main(String[] args) {
^
0_0_29603022_32294.cpp:26:26: error: 'String' has not been declared
public static void main(String[] args) {
^
0_0_29603022_32294.cpp:26:35: error: expected ',' or '...' before 'args'
public static void main(String[] args) {
^
0_0_29603022_32294.cpp:43:1: error: expected ';' after class definition
}
^
0_0_29603022_32294.cpp: In constructor 'Main::Main(int*)':
0_0_29603022_32294.cpp:9:34: error: request for member 'prices' in '(Main*)this', which is of pointer type 'Main*' (maybe you meant to use '->' ?)
Main(int[] prices, int m) {this.prices = prices; balance = m; N = prices.length; dp = new int[balance + 1];}
^
0_0_29603022_32294.cpp:9:43: error: 'prices' was not declared in this scope
Main(int[] prices, int m) {this.prices = prices; balance = m; N = prices.length; dp = new int[balance + 1];}
^
0_0_29603022_32294.cpp:9:61: error: 'm' was not declared in this scope
Main(int[] prices, int m) {this.prices = prices; balance = m; N = prices.length; dp = new int[balance + 1];}
^
0_0_29603022_32294.cpp:9:83: error: 'dp' was not declared in this scope
Main(int[] prices, int m) {this.prices = prices; balance = m; N = prices.length; dp = new int[balance + 1];}
^
0_0_29603022_32294.cpp: In member function 'void Main::solve()':
0_0_29603022_32294.cpp:12:3: error: 'Arrays' was not declared in this scope
Arrays.sort(prices);
^
0_0_29603022_32294.cpp:12:15: error: 'prices' was not declared in this scope
Arrays.sort(prices);
^
0_0_29603022_32294.cpp:16:5: error: 'dp' was not declared in this scope
dp[j] = Math.max(dp[j], dp[j - prices[i]] + prices[i]);
^
0_0_29603022_32294.cpp:16:13: error: 'Math' was not declared in this scope
dp[j] = Math.max(dp[j], dp[j - prices[i]] + prices[i]);
^
0_0_29603022_32294.cpp:20:3: error: 'System' was not declared in this scope
System.out.println(balance - dp[balance - 5] - prices[N - 1]);
^
0_0_29603022_32294.cpp:20:32: error: 'dp' was not declared in this scope
System.out.println(balance - dp[balance - 5] - prices[N - 1]);
^
0_0_29603022_32294.cpp: In static member function 'static void Main::main(int*)':
0_0_29603022_32294.cpp:28:3: error: 'Scanner' was not declared in this scope
Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
^
0_0_29603022_32294.cpp:30:12: error: 'in' was not declared in this scope
int N = in.nextInt(); //num of items
^
0_0_29603022_32294.cpp:32:7: error: expected unqualified-id before '[' token
int[] prices = new int[N];
^
0_0_29603022_32294.cpp:34:5: error: 'prices' was not declared in this scope
prices[i] = in.nextInt();
^
0_0_29603022_32294.cpp:37:22: error: 'prices' was not declared in this scope
Main m = new Main(prices, M);
^
|