解题思路
首先测试样例有错误,应该是
输入
5
1 2 3 4 5
10
输出
30
暴力解,找到所有和为m的求积。
import java.util.Scanner;
import java.util.HashMap;
import java.util.Iterator;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();