import java.util.Arrays; import java.util.Comparator; import java.util.Scanner; class Stu{ String sno; int scores; } public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); while(sc.hasNext()){ int n=sc.nextInt(); if(n==0)return; int m=sc.nextInt(); int sco=sc.nextInt(); int []a=new int[m];//分数 for (int j = 0; j < a.length; j++) { a[j]=sc.nextInt(); } Stu []s=new Stu[n];//学生数 for (int i = 0; i <n; i++) { s[i]=new Stu(); s[i].sno=sc.next(); int num=sc.nextInt(); for (int j = 0; j < num; j++) { s[i].scores+=a[sc.nextInt()-1]; } } Arrays.sort(s, new Comparator<Stu>(){ @Override public int compare(Stu o1, Stu o2) { if(o1.scores==o2.scores)return o1.sno.compareTo(o2.sno); return o2.scores-o1.scores; } }); int cnt=0; for (int i = 0; i < s.length; i++) { if(s[i].scores<sco){cnt=i; break;} } System.out.println(cnt); for (int i = 0; i < cnt; i++) { System.out.println(s[i].sno+" "+s[i].scores); } } sc.close(); } }
0.0分
1 人评分
三进制小数 (C语言代码)浏览:1025 |
C二级辅导-等差数列 (C语言代码)浏览:591 |
C二级辅导-阶乘数列 (C语言代码)浏览:691 |
WU-C语言程序设计教程(第三版)课后习题11.12 (C++代码)(想学链表的小伙伴可以看看)浏览:904 |
母牛的故事 (C语言代码)浏览:1428 |
完数 (C语言代码)浏览:693 |
妹子杀手的故事 (C语言代码)浏览:1054 |
震宇大神的杀毒软件 (C语言代码)浏览:1080 |
C语言程序设计教程(第三版)课后习题5.8 (C语言代码)浏览:673 |
C语言程序设计教程(第三版)课后习题8.9 (C语言代码)浏览:508 |