hdu 5162 Jump and Jump...
来源:互联网 发布:我的世界暮色森林js 编辑:程序博客网 时间:2024/05/18 03:41
按顺序输出每个人跳远距离的排名.
数据结构自定义排序,输出有点麻烦
#include<iostream>#include<algorithm>using namespace std;struct stu{int number;int max;int lv;};bool cmp(stu x,stu y){return x.max>y.max;}int main(){int t;cin>>t;while(t--){int n;cin>>n;stu a[n+1];int i,j;for(i=1;i<=n;i++){a[i].number=i;int x=0;for(j=0;j<3;j++){int y;cin>>y;x=max(x,y);}a[i].max=x;}sort(a+1,a+n+1,cmp);for(i=1;i<=n;i++){a[i].lv=i;}for(i=1;i<=n;i++){if(a[i].number==1){cout<<a[i].lv;}} for(i=2;i<=n;i++){for(j=1;j<=n;j++){if(a[j].number==i){cout<<' '<<a[j].lv;}}}cout<<endl;}return 0;}
0 0
- HDU 5162 Jump and Jump...
- hdu 5162 Jump and Jump...
- Jump and Jump... HDU 5162
- HDU 5162Jump and Jump...
- hdu 5162 Jump and Jump...(模拟)
- hdu 5612 Jump and Jump
- 【BestCoder】 HDOJ 5162 Jump and Jump...
- 1001Jump and Jump...
- 1001 Jump and Jump...
- Jump and Jump...
- 【CUGBACM15级BC第27场 A】hdu 5162 Jump and Jump...
- Jump
- Jump
- Jump
- jump
- Jump
- jump
- Jump
- macosx & ios
- Java实现文本按照自然段落进行切分
- dataguard :主库的一个归档日志没传送到备库,导致备库无法同步
- 机器学习资料整理
- Composite组合模式
- hdu 5162 Jump and Jump...
- flash上传头像插件使用说明
- 如何通过jsoup网络爬虫工具爬取网页数据,并通过jxl工具导出到excel
- Linux 挂载ISO问题-iso的命名不能出现空格
- uva514
- 纯CSS实现的背景渐变效果代码!
- Shell陷阱:$!和$?等变量在推送到远程主机执行时的取值问题
- 可控制图片放大缩小还原移动效果的JS网页图片查看器
- 队列之循环队列