Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Bismillahir Rahmanir Rahim
- /******Harun Or Rashid******/
- /***********Template Starts Here***********/
- #include<iostream>
- #include<cstdio>
- #include<cstring>
- #include<cmath>
- #include<cctype>
- #include<cstdlib>
- #include<string>
- #include<vector>
- #include<set>
- #include<stack>
- #include<queue>
- #include<map>
- #include<algorithm>
- using namespace std;
- #define MEM(a,b) memset(a,b,sizeof(a))
- #define CLR(a) memset(a,0,sizeof(a))
- #define MAX(a,b) ((a)>(b)?(a):(b))
- #define MIN(a,b) ((a)>(b)?(b):(a))
- #define ABS(a) ((a)>0? (a):(-(a)))
- #define SQ(a) ((a)*(a))
- #define SZ(a) (int)a.size()
- #define FORN(i,n) for(i=1;i<=n;i++)
- #define FORAB(i,a,b) for(i=a;i<=b;i++)
- #define ALL(V) V.begin(),V.end()
- #define pb(a) push_back(a)
- #define pr(a) cout<<a<<endl
- #define pf printf
- #define sf scanf
- #define swap(a,b) (a ^= b, b ^= a, a ^= b)
- #define PI acos(-1)
- #define x first
- #define y second
- #define eps 1e-7
- typedef int D;
- typedef double DD;
- typedef long long int LLD;
- typedef unsigned long long int LLU;
- typedef vector<D> VI;
- typedef set<D> SI;
- typedef vector<D>::iterator Viti;
- /***********Template Ends Here***********/
- DD distance(DD x1,DD y1,DD x2,DD y2)
- {
- DD result=((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));
- return result;
- }
- int main()
- {
- int N,i,cnt=0;
- DD AB,AC,BC,x1,y1,x2,y2,x3,y3,a,b,c;
- //pair<int,int>point;
- //vector<pair<int,int> >V;
- cin>>N;
- for(i=0; i<N; i++)
- {
- cin>>x1>>y1>>x2>>y2>>x3>>y3;
- AB=distance(x1,y1,x2,y2);
- AC=distance(x1,y1,x3,y3);
- BC=distance(x2,y2,x3,y3);
- c=MAX(MAX(AB,AC),BC);
- a=MIN(MIN(AB,AC),BC);
- b=AB+AC+BC-a-c;
- if(c==a+b)
- cnt++;
- }
- cout<<cnt<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement