結果

問題 No.1041 直線大学
ユーザー s_shohei
提出日時 2020-06-03 21:27:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 65 ms / 2,000 ms
コード長 307 bytes
コンパイル時間 157 ms
コンパイル使用メモリ 82,560 KB
実行使用メモリ 63,104 KB
最終ジャッジ日時 2024-11-16 08:04:21
合計ジャッジ時間 3,011 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 37
権限があれば一括ダウンロードができます

ソースコード

diff #

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

from itertools import *

ans=0
for itm in combinations(xy,2):
    x1,y1=itm[0]
    x2,y2=itm[1]

    cnt=0
    for p in xy:
        x,y=p
        if (y-y1)*(x2-x1) == (y2-y1)*(x-x1):
            cnt+=1
    ans = max(cnt,ans)
print(ans)
0