結果

問題 No.1041 直線大学
コンテスト
ユーザー s_shohei
提出日時 2020-06-03 21:27:08
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 42 ms / 2,000 ms
コード長 307 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 361 ms
コンパイル使用メモリ 85,376 KB
実行使用メモリ 63,360 KB
最終ジャッジ日時 2026-05-11 13:22:53
合計ジャッジ時間 2,970 ms
ジャッジサーバーID
(参考情報)
judge3_1 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 37
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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