#include<cstdio>
#include<vector>
#include<algorithm>
#include<string>
using namespace std;
#define ll long long
#define ccw(a,b,c) ( (a.x*b.y + b.x*c.y + c.x * a.y ) - ( a.y*b.x + b.y*c.x + c.y * a.x) )
struct pt{
ll x,y;
int pos;
pt(){}
pt(ll x,ll y){
this->x=x;
this->y=y;
}
};
pt v[1000];
pt STD;
bool compare(pt a,pt b){
return (ccw(STD,a,b) < 0);
}
int main(){
int n;scanf("%d",&n);
n*=3;
for(int i=0;i<n;i++){
ll x, y;scanf("%lld %lld",&x,&y);
v[i] = pt(x,y);
v[i].pos = i+1;
}
STD = pt(-1000001,-1000001);
sort(v,v+n,compare);
for(int i=0;i<n;i+=3)
printf("%d %d %d\n",v[i].pos,v[i+1].pos,v[i+2].pos);
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
1116 KB |
Output is correct |
2 |
Correct |
0 ms |
1116 KB |
Output is correct |
3 |
Correct |
0 ms |
1116 KB |
Output is correct |
4 |
Correct |
0 ms |
1116 KB |
Output is correct |
5 |
Correct |
0 ms |
1116 KB |
Output is correct |
6 |
Correct |
0 ms |
1116 KB |
Output is correct |
7 |
Correct |
0 ms |
1116 KB |
Output is correct |
8 |
Correct |
0 ms |
1116 KB |
Output is correct |
9 |
Correct |
0 ms |
1116 KB |
Output is correct |
10 |
Correct |
0 ms |
1116 KB |
Output is correct |
11 |
Correct |
0 ms |
1116 KB |
Output is correct |
12 |
Correct |
0 ms |
1116 KB |
Output is correct |
13 |
Correct |
0 ms |
1116 KB |
Output is correct |
14 |
Correct |
0 ms |
1116 KB |
Output is correct |
15 |
Correct |
0 ms |
1116 KB |
Output is correct |
16 |
Correct |
0 ms |
1116 KB |
Output is correct |
17 |
Correct |
0 ms |
1116 KB |
Output is correct |
18 |
Correct |
0 ms |
1116 KB |
Output is correct |
19 |
Correct |
0 ms |
1116 KB |
Output is correct |
20 |
Correct |
0 ms |
1116 KB |
Output is correct |