HDU 5162Jump and Jump...
来源:互联网 发布:投资软件 编辑:程序博客网 时间:2024/05/21 10:30
Jump and Jump...
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 250 Accepted Submission(s): 177
2310 10 1010 20 3010 10 2023 4 11 2 1
3 1 21 2HintFor the first case, the farthest distance each kid can jump is 10, 30 and 20. So the rank is 3, 1, 2.
#include<iostream>
#include<cstring>
#include<algorithm>
#include<cstdlib>
#include<vector>
#include<cmath>
#include<stdlib.h>
#include<iomanip>
#include<list>
#include<deque>
#include<map>
#include <stdio.h>
#include <queue>
#include <stack>
#define maxn 10000+5
#define ull unsigned long long
#define ll long long
#define reP(i,n) for(i=1;i<=n;i++)
#define rep(i,n) for(i=0;i<n;i++)
#define cle(a) memset(a,0,sizeof(a))
#define mod 90001
#define PI 3.141592657
#define INF 1<<30
const ull inf = 1LL << 61;
const double eps=1e-5;
using namespace std;
struct node
{
int id;
int v;
int t;
}nod[10];
bool cmp(node a,node b){
return a.v>b.v;
}
int t,n;
int a,b,c;
int main()
{
//freopen("in.txt","r",stdin);
//freopen("out.txt","w",stdout);
cin>>t;
while(t--)
{
cin>>n;
for(int i=1;i<=n;i++)
{
cin>>a>>b>>c;
nod[i].v=max(a,max(b,c));
nod[i].id=i;
}
sort(nod+1,nod+1+n,cmp);
for(int i=1;i<=n;i++)
{
nod[nod[i].id].t=i;
}
for(int i=1;i<n;i++)
{
cout<<nod[i].t<<" ";
}
cout<<nod[n].t<<endl;
}
return 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
- 数据挖掘相关资料收集(持续更新)
- 面试题目
- HDU 5163 Taking Bus
- 括号配对问题
- Activity之数据恢复
- HDU 5162Jump and Jump...
- 分解质因数
- HDU 5166 Missing number
- POJ 2528 Mayor\'s posters
- POJ 2828 Buy Tickets
- POJ 3468 A Simple Problem with Integers(区间更新)
- Can you find it?(二分)
- POJ 3264 Balanced Lineup(RMQ)
- POJ 3368 Frequent values (RMQ)