結果

問題 No.1041 直線大学
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2020-05-01 21:31:02
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 71 ms / 2,000 ms
コード長 559 bytes
コンパイル時間 551 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 73,372 KB
最終ジャッジ日時 2023-12-19 17:01:23
合計ジャッジ時間 3,736 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,588 KB
testcase_01 AC 38 ms
53,588 KB
testcase_02 AC 37 ms
53,588 KB
testcase_03 AC 37 ms
53,588 KB
testcase_04 AC 37 ms
53,588 KB
testcase_05 AC 37 ms
53,588 KB
testcase_06 AC 37 ms
53,588 KB
testcase_07 AC 38 ms
53,588 KB
testcase_08 AC 38 ms
53,588 KB
testcase_09 AC 39 ms
53,588 KB
testcase_10 AC 47 ms
62,248 KB
testcase_11 AC 48 ms
62,240 KB
testcase_12 AC 48 ms
62,224 KB
testcase_13 AC 40 ms
53,588 KB
testcase_14 AC 60 ms
68,664 KB
testcase_15 AC 41 ms
53,588 KB
testcase_16 AC 56 ms
66,572 KB
testcase_17 AC 38 ms
53,588 KB
testcase_18 AC 48 ms
62,352 KB
testcase_19 AC 56 ms
66,572 KB
testcase_20 AC 37 ms
53,588 KB
testcase_21 AC 52 ms
64,484 KB
testcase_22 AC 37 ms
53,588 KB
testcase_23 AC 68 ms
71,264 KB
testcase_24 AC 61 ms
68,664 KB
testcase_25 AC 52 ms
64,480 KB
testcase_26 AC 39 ms
53,588 KB
testcase_27 AC 40 ms
53,588 KB
testcase_28 AC 37 ms
53,588 KB
testcase_29 AC 37 ms
53,588 KB
testcase_30 AC 37 ms
53,588 KB
testcase_31 AC 37 ms
53,588 KB
testcase_32 AC 37 ms
53,588 KB
testcase_33 AC 37 ms
53,588 KB
testcase_34 AC 37 ms
53,588 KB
testcase_35 AC 37 ms
53,588 KB
testcase_36 AC 37 ms
53,588 KB
testcase_37 AC 37 ms
53,588 KB
testcase_38 AC 71 ms
73,372 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
N = int(input())

XY = []

for i in range(N):

    x,y = map(int,input().split())
    XY.append([x,y])

ans = 1

for i in range(N):

    ox,oy = XY[i]
    dic = {}

    for j in range(i):

        nx,ny = XY[j]

        x = ox-nx
        y = oy-ny

        XX = x // math.gcd(x,y)
        YY = y // math.gcd(x,y)

        if XX < 0:
            XX *= -1
            YY *= -1

        if (XX,YY) not in dic:
            dic[(XX,YY)] = 1
        else:
            dic[(XX,YY)] += 1

    for t in dic:
        ans = max(ans,dic[t] + 1)

print (ans)
0