Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Solution by Aytbayev Sherzat
- #pragma comment(linker, "/STACK:64000000")
- #define _CRT_NO_WARNINGS
- #include<iostream>
- #include<fstream>
- #include<ctime>
- #include<algorithm>
- #include<map>
- #include<ctime>
- #include<cstdio>
- #include<string>
- #include<math.h>
- #include<vector>
- #include<set>
- #include<deque>
- #include<cstdlib>
- #include<utility>
- #define abs(x) ((x) < 0 ? -(x) : (x))
- #define mp make_pair
- #define PI pair<int, int>
- #define VI vector <int>
- #define VB vector <bool>
- #define FOR(i, n) for(int (i) = 0; (i) < (n); (i)++)
- #define VP vector <PI>
- #define INF 1 << 30
- #define pb push_back
- #define ll long long
- #define fi first
- #define se second
- #define debug cerr << "a ";
- using namespace std;
- int n, x[2010], y[2010];
- map < pair < pair <ll, ll>, ll>, set <int> > m;
- //map < pair < pair <long long, int>, int>, set <int> > m;
- int main(){
- // #ifndef ONLINE_JUDGE
- freopen("input.txt", "r", stdin);
- freopen("output.txt", "w", stdout);
- // #endif
- cin >> n;
- for(int i = 0; i < n; ++i)
- cin >> x[i] >> y[i];
- for(int i = 0; i < n; ++i)
- for(int j = 0; j < n; ++j)
- if(i != j){
- ll A, B, C;
- A = 1LL * y[j] - 1LL * y[i];
- B = 1LL * x[i] - 1LL * x[j];
- C = -(1LL * A * x[j] + 1LL * B * y[j]);
- m[mp(mp(A, B), C)].insert(i);
- m[mp(mp(A, B), C)].insert(j);
- }
- int mx = 1;
- for(map < pair < pair <ll, ll>, ll>, set <int> > :: iterator it = m.begin(); it != m.end(); it++){
- set <int> q = it->se;
- mx = max(mx, (int)q.size());
- }
- cout << mx;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement