結果

問題 No.1041 直線大学
ユーザー H3PO4H3PO4
提出日時 2020-05-01 21:40:19
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 69 ms / 2,000 ms
コード長 452 bytes
コンパイル時間 489 ms
コンパイル使用メモリ 10,768 KB
実行使用メモリ 10,884 KB
最終ジャッジ日時 2023-08-26 08:17:53
合計ジャッジ時間 3,297 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
9,696 KB
testcase_01 AC 29 ms
9,816 KB
testcase_02 AC 29 ms
9,708 KB
testcase_03 AC 27 ms
9,676 KB
testcase_04 AC 28 ms
9,672 KB
testcase_05 AC 26 ms
9,824 KB
testcase_06 AC 26 ms
9,772 KB
testcase_07 AC 28 ms
9,876 KB
testcase_08 AC 28 ms
9,720 KB
testcase_09 AC 29 ms
9,712 KB
testcase_10 AC 66 ms
10,500 KB
testcase_11 AC 30 ms
10,216 KB
testcase_12 AC 69 ms
10,620 KB
testcase_13 AC 32 ms
9,900 KB
testcase_14 AC 47 ms
10,640 KB
testcase_15 AC 34 ms
10,100 KB
testcase_16 AC 42 ms
10,284 KB
testcase_17 AC 27 ms
9,628 KB
testcase_18 AC 34 ms
10,012 KB
testcase_19 AC 43 ms
10,404 KB
testcase_20 AC 27 ms
9,676 KB
testcase_21 AC 37 ms
10,124 KB
testcase_22 AC 27 ms
9,856 KB
testcase_23 AC 60 ms
10,884 KB
testcase_24 AC 48 ms
10,448 KB
testcase_25 AC 38 ms
9,952 KB
testcase_26 AC 28 ms
9,796 KB
testcase_27 AC 33 ms
10,108 KB
testcase_28 AC 26 ms
9,828 KB
testcase_29 AC 27 ms
9,828 KB
testcase_30 AC 28 ms
9,768 KB
testcase_31 AC 26 ms
9,676 KB
testcase_32 AC 26 ms
9,772 KB
testcase_33 AC 26 ms
9,784 KB
testcase_34 AC 27 ms
9,840 KB
testcase_35 AC 26 ms
9,568 KB
testcase_36 AC 27 ms
9,832 KB
testcase_37 AC 26 ms
9,676 KB
testcase_38 AC 64 ms
10,884 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools
from collections import Counter
from fractions import Fraction
from math import isqrt

N = int(input())
P = [tuple(map(int, input().split())) for _ in range(N)]
ct = []
for (x0, y0), (x1, y1) in itertools.combinations(P, 2):
    if x0 != x1:
        d = Fraction(y1 - y0, x1 - x0)
        c = y0 - x0 * d
    else:
        d = float('inf')
        c = x0
    ct.append((c,d))
ct = Counter(ct)
M=max(ct.values())
print(isqrt(M * 2) + 1)
0