結果

問題 No.1041 直線大学
ユーザー Mine
提出日時 2020-09-01 18:56:34
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 309 ms / 2,000 ms
コード長 469 bytes
コンパイル時間 442 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2024-11-16 08:08:24
合計ジャッジ時間 4,345 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 37
権限があれば一括ダウンロードができます

ソースコード

diff #

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

ans = 0
for i in range(n):
    for g in range(i+1, n):
        same = 2
        s = xy[i]
        t = xy[g]
        tan = math.atan2(t[1]-s[1], t[0]-s[0])
        for l in range(n):
            if i == l or g == l:
                continue
            x, y = xy[l]
            if tan == math.atan2(y-s[1], x-s[0]):
                same += 1
        ans = max(ans, same)

print(ans)
0