0_0_35897566_14378\Main.java:1: 错误: 类CF1079A是公共的, 应在名为 CF1079A.java 的文件中声明
import java.util.HashSet; import java.util.Scanner; public class CF1079A { public static void main(String[] args) { Scanner s = new Scanner(System.in); int[] num = new int[101]; int n = s.nextInt(); int k = s.nextInt(); int max = 0; HashSet<Integer> set = new HashSet<Integer>(); for(int i =0;i<n;i++) { int a = s.nextInt(); num[a]++; max = Math.max(max, num[a]); set.add(a); } max = max%k==0?max:(max/k+1)*k; int c = 0; for (Integer integer : set) { c += max-num[integer]; } System.out.println(c); s.close(); } }
^
1 个错误
|