我的在本地运行都是正确的,为什么提交上去就出现这样的错误,有人知道为什么吗? Runtime Error:[ERROR] A Not allowed system call:runid:192985 callid:20 TO FIX THIS,ask admin to add the CALLID int corresponding LANG_XXV[] located at okcalls32/64.h,and recompile judge_client
数学和计算机IQ题,贪心过。从计算机最低IQ的同学开始试探,是否可以调,直到最后一个。
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while (sc.hasNext()) {
int n = sc.nextInt();
double sumS = 0;
for (int i = 0; i < n; i ++) {
sumS += sc.nextInt();
}
double sss = sumS / n;
int m = sc.nextInt();
List<Integer> nums = new ArrayList<>();
double sumJ = 0;
for (int i = 0; i < m; i ++) {
int tmp = sc.nextInt();
nums.add(tmp);
sumJ += tmp;
}
Collections.sort(nums);
int cntJ = m;
int cntS = n;
int res = 0;
for (int i = 0; i < m; i ++) {
int num = nums.get(i);
if ((sumS + num) / (cntS + 1) > sumS/cntS &&
(sumJ - num) / (cntJ - 1) > sumJ/cntJ) {
sumS += num;
sumJ -= num;
cntS += 1;
cntJ -= 1;
res += 1;
}
}
System.out.println(res);
}
sc.close();
}
}