結果

問題 No.1041 直線大学
ユーザー fusmafusma
提出日時 2020-05-20 16:18:10
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 71 ms / 2,000 ms
コード長 462 bytes
コンパイル時間 147 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 72,448 KB
最終ジャッジ日時 2024-04-28 00:16:05
合計ジャッジ時間 2,845 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
53,632 KB
testcase_01 AC 41 ms
53,888 KB
testcase_02 AC 39 ms
53,760 KB
testcase_03 AC 43 ms
53,888 KB
testcase_04 AC 45 ms
53,760 KB
testcase_05 AC 46 ms
53,504 KB
testcase_06 AC 45 ms
54,016 KB
testcase_07 AC 43 ms
54,272 KB
testcase_08 AC 44 ms
54,272 KB
testcase_09 AC 45 ms
54,272 KB
testcase_10 AC 47 ms
62,592 KB
testcase_11 AC 48 ms
62,336 KB
testcase_12 AC 50 ms
63,488 KB
testcase_13 AC 40 ms
54,400 KB
testcase_14 AC 64 ms
68,608 KB
testcase_15 AC 41 ms
54,912 KB
testcase_16 AC 57 ms
66,048 KB
testcase_17 AC 38 ms
54,144 KB
testcase_18 AC 53 ms
63,488 KB
testcase_19 AC 56 ms
65,792 KB
testcase_20 AC 38 ms
53,888 KB
testcase_21 AC 50 ms
63,488 KB
testcase_22 AC 37 ms
53,760 KB
testcase_23 AC 71 ms
72,448 KB
testcase_24 AC 61 ms
68,096 KB
testcase_25 AC 52 ms
64,384 KB
testcase_26 AC 39 ms
54,528 KB
testcase_27 AC 39 ms
54,784 KB
testcase_28 AC 36 ms
53,504 KB
testcase_29 AC 37 ms
53,760 KB
testcase_30 AC 37 ms
53,632 KB
testcase_31 AC 36 ms
53,504 KB
testcase_32 AC 36 ms
54,144 KB
testcase_33 AC 36 ms
53,632 KB
testcase_34 AC 37 ms
53,632 KB
testcase_35 AC 42 ms
53,632 KB
testcase_36 AC 41 ms
53,888 KB
testcase_37 AC 43 ms
53,888 KB
testcase_38 AC 71 ms
71,808 KB
testcase_39 AC 41 ms
55,040 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
from collections import Counter
def yakubun(a,b):
    if b == 0:
        return (1,0)
    elif a == 0:
        return (0,1)
    g = math.gcd(a,b)
    return (math.copysign(1,b) * (a//g)  ,abs(b//g))
ans = 0
N = int(input())
XY = [[int(hoge) for hoge in input().split()] for n in range(N)]
for s in range(N-1):
    sx,sy = XY[s]
    G = [yakubun(gx-sx,gy-sy) for gx,gy in XY[s+1:]]
    C = Counter(G)
    ans = max(ans,1 + max(C.values()))
print(ans)
0