//TreeMap自动排序去重,key已存在就做加法更新value import java.util.TreeMap; public class Main { public static void main(String[] args) { TreeMap<Integer,Integer> treeMap = new TreeMap<>(); Scanner sc = new Scanner(System.in); int n = sc.nextInt(); for (int i = 0;i <...