Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- struct stars
- {
- int x,y,pos;
- };
- int main()
- {
- int n,i=0;
- stars temp,star[100000];
- cin>>n;
- while(n--){
- cin>>star[i].x>>star[i].y;
- star[i].pos=i;
- i++;
- }
- n=i;
- for(int i=2;i<n;i++)
- for(int j=i+1;j<n;j++)
- {
- if((star[i].x>star[j].x)||((star[i].x==star[j].x)&&(star[i].y>star[j].y)))
- {
- temp=star[i];
- star[i]=star[j];
- star[j]=temp;
- }
- }
- for(i=2;i<n;i++)
- {
- if((star[0].x*(star[1].y-star[i].y) + star[1].x*(star[i].y-star[0].y) + star[i].x*(star[0].y-star[1].y)) != 0) break;
- }
- printf("%d %d %d\n",1+star[0].pos,1+star[1].pos,star[i].pos+1);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement