結果
| 問題 | No.1041 直線大学 | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2020-05-01 21:40:19 | 
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 87 ms / 2,000 ms | 
| コード長 | 452 bytes | 
| コンパイル時間 | 265 ms | 
| コンパイル使用メモリ | 12,672 KB | 
| 実行使用メモリ | 13,440 KB | 
| 最終ジャッジ日時 | 2024-11-16 07:51:16 | 
| 合計ジャッジ時間 | 3,588 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 37 | 
ソースコード
import itertools
from collections import Counter
from fractions import Fraction
from math import isqrt
N = int(input())
P = [tuple(map(int, input().split())) for _ in range(N)]
ct = []
for (x0, y0), (x1, y1) in itertools.combinations(P, 2):
    if x0 != x1:
        d = Fraction(y1 - y0, x1 - x0)
        c = y0 - x0 * d
    else:
        d = float('inf')
        c = x0
    ct.append((c,d))
ct = Counter(ct)
M=max(ct.values())
print(isqrt(M * 2) + 1)
            
            
            
        