给出二维平面上的n个点,求最多有多少点在同一条直线上。
样例:
给出4个点:(1, 2), (3, 6), (0, 0), (1, 3)。
一条直线上的点最多有3个。
思想:
利用map
#ifndef C186_H
#define C186_H
#include<iostream>
#include<vector>
#include<cmath>
#include<map>
using namespace std;
struct Point{
int x;
int y;
Point() :x(0), y(0) {}
Point(int a, int b) :x(a), y(b) {}
};