排名 hdu1236
来源:互联网 发布:mysql c开发工具 编辑:程序博客网 时间:2024/04/25 14:53
#include<iostream>//2272775 2010-03-31 18:27:45 Accepted 1236 78MS 276K 919 B C++ 悔惜晟
#include<cstdio>
#include<algorithm>
#include<string>
using namespace std;
struct stu
{
char name[25];
int chengji;
int num;
//int b[11];
}df[1005];
int cmp(stu a, stu b)
{
if(a.chengji == b.chengji)
return strcmp(a.name , b.name) < 0;
else
return a.chengji > b.chengji;
}
int main()
{
int n, m, g, a[11], b[11];
while(scanf("%d", &n) != EOF && n != 0)
{
memset(df,0,sizeof(df));
scanf("%d%d", &m, &g);
int i;
int j;
int count = 0;
for( i = 1; i <= m; i++)
scanf("%d", &a[i]);
for(i = 0; i < n; i++)
{
scanf("%s%d", df[i].name, &df[i].num);
for(j = 0 ; j < df[i].num; j++)
{
scanf("%d", &b[j]);
df[i].chengji += a[b[j]];
}
if(df[i].chengji >= g)
count++;
}
sort(df, df+n, cmp);
printf("%d/n", count);
for(i = 0; i < count ; i++)
printf("%s %d/n",df[i].name,df[i].chengji);
}
}
- 排名 hdu1236
- HDU1236:排名
- hdu1236(排名)
- hdu1236 排名
- hdu1236排名
- HDU1236 排名
- HDU1236排名
- hdu1236排名
- HDU1236 排名
- HDU1236排名
- hdu1236(排名)
- HDU1236排名(排序)
- HDU1236 排名 题解
- hdu1236排名(结构体)
- hdu1236 排名(结构体排序)
- HDU1236排名(结构体排序)
- hdu1236
- hdu1236
- FreeTextBox使用详解
- POJ 滑雪
- sql语句查询时is not null 的使用
- 创建mysql数据库
- 设置Double类型数值对象的小数后位数
- 排名 hdu1236
- HP's Growth
- 小小的我,迈开了人生的第一步
- 拒绝平庸,选择卓越
- C++ STL学习笔记一
- SQL随机排序
- Ajax基础概念
- 火星人与房子问题
- 163邮箱编辑器在FF火狐下不能提交数据的解决方案