Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <bits/stdc++.h>
- #include <stdio.h>
- #include <math.h>
- #include <cmath>
- using namespace std;
- pair<double,double> bruh;
- map<int,pair<double,double>> dude;
- set<int> s;
- int main() {
- int n,i,k,j,sum=0;
- double x,y;
- int min = INT_MAX, max = INT_MIN;
- scanf("%d",&n);
- for(i=0;i<n;i++) {
- scanf("%lf %lf",&x,&y);
- s.insert(x);
- bruh = make_pair(x,y);
- dude[x] = bruh;
- if(x<min) {
- min = x;
- }
- if(x>max) {
- max = x;
- }
- }
- for(i=min;i<=max;i++) {
- for(j=i+2;j<=max;j++) {
- for(k=i+1;k<j;k++) {
- if(s.count(k)!=1) {
- continue;
- } else {
- if((dude[i].first + dude[j].first)/2 == dude[k].first && (dude[i].second + dude[j].second)/2 == dude[k].second);
- sum++;
- }
- }
- }
- }
- printf("%d\n",sum);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement