#include <stdio.h>
#include <algorithm>
#include <string.h>
#include <vector>
int n;
struct q{
int x,y,no;
bool operator() (q a,q b){
return a.x<b.x || (a.x==b.x && a.y<b.y);
}
}su[10001];
int main(){
scanf("%d",&n);
int i;
for(i=0;i<3*n;i++){
scanf("%d %d",&su[i].x,&su[i].y);
su[i].no=i+1;
}
std::sort(su,su+n*3,q());
for(i=0;i<n;i++){
printf("%d %d %d\n",su[i*3].no,su[i*3+1].no,su[i*3+2].no);
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
1204 KB |
Output is correct |
2 |
Correct |
0 ms |
1204 KB |
Output is correct |
3 |
Correct |
0 ms |
1204 KB |
Output is correct |
4 |
Correct |
0 ms |
1204 KB |
Output is correct |
5 |
Correct |
0 ms |
1204 KB |
Output is correct |
6 |
Correct |
0 ms |
1204 KB |
Output is correct |
7 |
Correct |
0 ms |
1204 KB |
Output is correct |
8 |
Correct |
0 ms |
1204 KB |
Output is correct |
9 |
Correct |
0 ms |
1204 KB |
Output is correct |
10 |
Correct |
0 ms |
1204 KB |
Output is correct |
11 |
Correct |
0 ms |
1204 KB |
Output is correct |
12 |
Correct |
0 ms |
1204 KB |
Output is correct |
13 |
Correct |
0 ms |
1204 KB |
Output is correct |
14 |
Correct |
0 ms |
1204 KB |
Output is correct |
15 |
Correct |
0 ms |
1204 KB |
Output is correct |
16 |
Correct |
0 ms |
1204 KB |
Output is correct |
17 |
Correct |
0 ms |
1204 KB |
Output is correct |
18 |
Correct |
0 ms |
1204 KB |
Output is correct |
19 |
Correct |
0 ms |
1204 KB |
Output is correct |
20 |
Correct |
0 ms |
1204 KB |
Output is correct |