考试排名
来源:互联网 发布:netsnmp windows配置 编辑:程序博客网 时间:2024/05/01 22:40
http://acm.hdu.edu.cn/game/entry/problem/show.php?chapterid=1§ionid=3&problemid=12
#include<bits/stdc++.h>using namespace std;struct node{ int a,b; char c[20];};node g[1000];bool cmp(node x,node y){ if(x.a!=y.a) return x.a>y.a; if(x.b!=y.b) return x.b<y.b; return strcmp(x.c,y.c)<0;}char s[15];int time(int m){ if(s[0]=='-'||s[0]=='0') return 0; int i,ans=0,sum=0; int n=strlen(s); for(i=0;i<n;i++) { if(s[i]=='(') break; ans=ans*10+s[i]-'0'; } for(i++;i<n-1;i++) sum=sum*10+s[i]-'0'; return sum*m+ans;}int main(){ int i,j,k,ans,m,n,t,tt=0,tmp; while(~scanf("%d%d",&n,&m)) { memset(g,0,sizeof(g)); k=0; while(~scanf("%s",&g[k++].c)) { for(i=0;i<n;i++) { scanf("%s",&s); tmp=time(m); if(tmp) g[k-1].a++; g[k-1].b+=tmp; } }k--; sort(g,g+k,cmp); for(i=0;i<k;i++) printf("%-10s %2d %4d\n",g[i].c,g[i].a,g[i].b); } return 0;}
0 0
- 考试排名
- 考试排名
- 考试排名
- 考试排名
- 考试排名
- 考试排名
- 考试排名
- 考试排名
- 考试排名
- 考试排名
- 考试排名 hdu 2903
- 2093考试排名
- HDOJ-考试排名
- hdu 2093 考试排名
- hdu2093 考试排名
- HDU 2093 - 考试排名
- HDU 2093 考试排名
- HDU 2093 考试排名
- NodeJs获取请求参数的方法(get方式)
- xcode运行模拟器 提示LaunchServicesError error 0 完美解决办法
- mongodb-1.环境搭建(ubuntu)学习笔记
- 安装的虚拟机没有了VMnet1
- 实现android的 google第三方登陆
- 考试排名
- coreLocation说明,作者写的很用心,收藏
- NodeJs如何处理请求的路由
- mongodb-2.增删改查--学习笔记
- FB05 清账
- NSMutableArray的双条件或多条件排序
- Effective cpp 读书笔记4
- oracle sql 解析过程
- iOS开发之实现模糊效果 Core Image 、 vImage 、UIVisualEffectView、FXBlurView、GPUImage、UIImage+ImageEffects