Refactored all solutions
This commit is contained in:
@@ -5,20 +5,18 @@
|
||||
import java.util.Scanner;
|
||||
import java.util.HashMap;
|
||||
|
||||
/* Use a HashMap as a cache to speed up runtime
|
||||
*
|
||||
* Tricky: Must use "long" instead of "int" to avoid integer overflow
|
||||
*/
|
||||
// Use a HashMap as a cache to speed up runtime
|
||||
// Must use "long" instead of "int" to avoid integer overflow
|
||||
|
||||
public class Solution {
|
||||
|
||||
public static void main(String[] args) {
|
||||
/* Read and save input */
|
||||
public static void main(String [] args) {
|
||||
/* Save input */
|
||||
Scanner scan = new Scanner(System.in);
|
||||
int n = scan.nextInt();
|
||||
int m = scan.nextInt();
|
||||
int coins[] = new int[m];
|
||||
for (int coins_i = 0; coins_i < m; coins_i++) {
|
||||
coins[coins_i] = scan.nextInt();
|
||||
int [] coins = new int[m];
|
||||
for (int i = 0; i < m; i++) {
|
||||
coins[i] = scan.nextInt();
|
||||
}
|
||||
scan.close();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user