結果

問題 No.1041 直線大学
ユーザー NatsubiSogan
提出日時 2020-11-21 15:31:00
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 265 ms / 2,000 ms
コード長 334 bytes
コンパイル時間 129 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-11-16 08:10:06
合計ジャッジ時間 3,814 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 37
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import combinations
n = int(input())
xy = [list(map(int, input().split())) for i in range(n)]
ans = 0
for c in combinations(xy, 2):
    a, b = c
    x1, y1 = a
    x2, y2 = b
    cnt = 0
    for x, y in xy:
        if (x1 - x) * (y1 - y2) == (x1 - x2) * (y1 - y):
            cnt += 1
    ans = max(ans, cnt)
print(ans)
0