結果

問題 No.1041 直線大学
ユーザー yatsurugi
提出日時 2020-09-25 12:07:31
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 389 bytes
コンパイル時間 85 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-06-28 05:47:56
合計ジャッジ時間 3,608 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 31 WA * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import combinations

N = int(input())
XY = [list(map(int, input().split())) for i in range(N)]

cnt = 0
for P, Q in combinations(XY, 2):
    x1, y1 = P[0], P[1]
    x2, y2 = Q[0], Q[1]
    a = (y1 - y2) / (x1 - x2) if x1 - x2 != 0 else 0
    b = y1 - a * x1
    tmp = 0
    for x, y in XY:
        if y == a * x + b:
            tmp += 1
    cnt = max(cnt, tmp)

print(cnt)
0