#include<bits/stdc++.h>
using namespace std;
struct hh
{
int hao;
int h;
int l;
int r;
}a[100000];
int main()
{
int n;
cin>>n;
for(int i=1;i<=n;i++)
{
a[i].hao=i;
cin>>a[i].h>>a[i].l>>a[i].r;
}
for(int i=1;i<=n;i++)
{
int ceng=0,max_high=-1000000;
for(int j=1;j<=n;j++)
{
if(i==j)continue;
if(a[i].h<=a[j].h)continue;
if(a[i].l<=a[j].l)continue;
if(a[j].h<=max_high)continue;
ceng=j;
}
cout<<ceng<<" ";
ceng=0;
max_high=-1000000;
for(int j=1;j<=n;j++)
{
if(i==j)continue;
if(a[i].h<=a[j].h)continue;
if(a[i].r>=a[j].r)continue;
if(a[j].h<=max_high)continue;
ceng=j;
}
cout<<ceng<<endl;
}
return 0;
}
看了好久感觉没啥问题啊~