Advertisement
cosenza987

asdasdas

Mar 4th, 2021
809
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.99 KB | None | 0 0
  1. #include <iostream>
  2. #include <bits/stdc++.h>
  3. #include <stdio.h>
  4. #include <math.h>
  5. #include <cmath>
  6.  
  7. using namespace std;
  8. pair<double,double> bruh;
  9. map<int,pair<double,double>> dude;
  10. set<int> s;
  11.  
  12. int main() {
  13.     int n,i,k,j,sum=0;
  14.     double x,y;
  15.     int min = INT_MAX, max = INT_MIN;
  16.     scanf("%d",&n);
  17.     for(i=0;i<n;i++) {
  18.         scanf("%lf %lf",&x,&y);
  19.         s.insert(x);
  20.         bruh = make_pair(x,y);
  21.         dude[x] = bruh;
  22.         if(x<min) {
  23.             min = x;
  24.         }
  25.         if(x>max) {
  26.             max = x;
  27.         }
  28.     }
  29.     for(i=min;i<=max;i++) {
  30.         for(j=i+2;j<=max;j++) {
  31.            for(k=i+1;k<j;k++) {
  32.                if(s.count(k)!=1) {
  33.                    continue;
  34.                } else {
  35.                    if((dude[i].first + dude[j].first)/2 == dude[k].first && (dude[i].second + dude[j].second)/2 == dude[k].second);
  36.                    sum++;
  37.                }
  38.            }
  39.         }
  40.     }
  41.     printf("%d\n",sum);
  42.     return 0;
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement