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 人评分
2004年秋浙江省计算机等级考试二级C 编程题(2) (C语言代码)浏览:1341 |
整数平均值 (C语言代码)浏览:787 |
整除问题 (C语言代码)浏览:526 |
A+B for Input-Output Practice (IV) (C语言代码)浏览:471 |
C语言程序设计教程(第三版)课后习题1.5 (C++代码)浏览:406 |
简单的a+b (C语言代码)浏览:562 |
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:452 |
自编的贪吃蛇小游戏,代码装上easyx图形库就能运行。浏览:942 |
银行业务队列浏览:1218 |
C语言程序设计教程(第三版)课后习题7.2 (C语言代码)浏览:350 |