emmm.....我也用的list,不过我没用排序,代码如下。。互相学习。 public static void main(String[] args) { // TODO Auto-generated method stub int lowCount=0; Scanner s1=new Scanner(System.in); List<Integer> a1=new ArrayList(); List<Integer> a2=new ArrayList(); List<Integer> a3=new ArrayList(); int count=Integer.parseInt(s1.nextLine()); for (int i = 0; i < count; i++) { String io2 = s1.nextLine(); String[] str2 = io2.split("\\s+"); a1.add(Integer.parseInt(str2[0])); a2.add(Integer.parseInt(str2[1])); a3.add(Integer.parseInt(str2[2])); } for (int i = a1.size()-1 ; i >=0;i--) { for (int j = 0; j <a1.size(); j++) { if(a1.get(i) < a1.get(j) && a2.get(i) < a2.get(j) && a3.get(i) < a3.get(j)){ lowCount++; a1.remove(i); a2.remove(i); a3.remove(i); break; } } } System.out.println(lowCount); }
点赞 评论

相关推荐

存一下准备挨个投一下
小小:银行秋招真题,欢迎大家来刷:牛客 -> 题库 -> 国央企笔试真题 。https://www.nowcoder.com/exam/company?questionJobId=195&subTabName=written_page
点赞 评论 收藏
分享
09-16 16:47
门头沟学院 C++
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务