这样写更简洁 import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int num = 100, res = 0; int n = sc.nextInt(); int p = sc.nextInt(); int q = sc.nextInt(); int[] scores = new int[n]; for (int i = 0; i < n; i++) scores[i] = sc.nextInt(); Arrays.sort(scores); for (int i = n - 1; i >= 0; i--) { if (i < n - 1 && scores[i] < scores[i + 1]) num--; double sum = (p * num + q * scores[i]) / 100; if (sum >= 60) res++; } System.out.println(res); } }

相关推荐

浩浩没烦恼:一二面加起来才一个小时? 我一面就一个小时多了
点赞 评论 收藏
分享
丿南烟丶:黑白模板吧,不要这样花哨的。 主要成就太空了,和获奖融在一起,写一两行就行了。 职业技能不要这样排,就传统的掌握精通什么什么然后举例补充的一些重要技术点。 自我介绍说实话也没啥用,可以删了。 把自己的两个项目方案细节补充上去,为什么这样设计,怎么设计,成果是什么按star法则来写 你要引导面试官来问你的技能和项目,你的获奖和自我介绍别人可能看都不看一眼或者不太在乎,重要的是展示你能干活的能力
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务