Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ConsoleApplication211.cpp : Defines the entry point for the console application.
- //
- #include "stdafx.h"
- #include <iomanip>
- #include <iostream>
- #include <functional>
- #include <algorithm>
- #include <math.h>
- #include <cmath>
- #include <string>
- #include <cstring>
- #include <vector>
- #include<set>
- #include<map>
- #include <time.h>
- #include <fstream>
- typedef long long ll;
- using namespace std;
- /*
- 4
- 13 7 5
- 7 13 6
- 14 3 12
- 15 6 16
- 0
- */
- int main(){
- map<pair<int, int>,int >mp;
- int n;
- cin >> n;
- int ans = 0;
- int x[2001], y[2001];
- for (int i = 0; i < n; i++){
- cin >>x[i]>> y[i];
- }
- map<pair<int, int>, int >mp2;
- for (int i = 0; i < n; i++){
- for (int k = i+1; k < n; k++){
- pair<int, int> d,d2,d3,d4;
- d.first = -(x[k] - x[i]);
- d.second = (y[i] - y[k]);
- d2.first = -d.first;
- d2.second = -d.second;
- ans += mp[d];
- ans += mp2[d2];
- //ans += mp[d2];
- /*if (d.first==-1&&d.second==0){
- cout << d.first << d.second << '\n';
- cout << mp[d]<<'\t'<<ans << "\n";
- }*/
- ++mp2[d2];
- ++mp[d];
- }
- }
- cout << ans;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement