問題一覧 > 通常問題

No.1041 Straight Line University

レベル : / AI推定難易度 : 214 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 379
作問者 : Suunn / テスター : trineutron
お気に入りにしたユーザー ProblemId : 3436 / 自分の提出
問題文最終更新日: 2020-01-05 19:00:09
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 246 (順位表) の他の問題:

Problem Statement

 Takahashi is a student at Straight Line University (abbreviated as SLU).
 
 Today's lecture at Straight Line University covered collinear points (points that lie on the same straight line). Takahashi found today's lecture interesting, so he decided to draw $N$ points on the coordinate plane and investigate how many points a single straight line can pass through at most. The coordinates of the $i$-th point Takahashi drew are $(X_i,Y_i)$.

 However, Takahashi got tired partway through and fell asleep. Please find the answer to this problem in his place.

Input

$N$
$X_1\ Y_1$
$X_2\ Y_2$
$\vdots$
$X_N\ Y_N$

$2\le N\le 100$
$0\le X_i,Y_i\le 100$
If $i \neq j $, then $(X_i,Y_i) \neq (X_j,Y_j)$
All input values are integers.

Output

Output the number of points passed through by the straight line that passes through the largest number of the points Takahashi drew.

Sample

Sample 1
Input
2
1 2
3 4
Output
2

There is no line passing through $2$ points other than the line through $(1,2) , (3,4)$.

Sample 2
Input
4
1 2
2 4
3 7
4 8
Output
3

$(1,2), (2,4), (4,8)$ lie on a single straight line.

Sample 3
Input
4
0 0
0 1
1 0
1 1
Output
2

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。