結果

問題 No.1041 直線大学
ユーザー ValkyrjaValkyrja
提出日時 2020-05-11 13:42:12
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 437 bytes
コンパイル時間 210 ms
コンパイル使用メモリ 10,980 KB
実行使用メモリ 8,380 KB
最終ジャッジ日時 2023-09-25 12:28:27
合計ジャッジ時間 4,110 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,244 KB
testcase_01 AC 16 ms
8,160 KB
testcase_02 AC 16 ms
8,264 KB
testcase_03 AC 16 ms
8,212 KB
testcase_04 AC 16 ms
8,204 KB
testcase_05 AC 16 ms
8,324 KB
testcase_06 AC 16 ms
8,248 KB
testcase_07 AC 19 ms
8,376 KB
testcase_08 AC 19 ms
8,316 KB
testcase_09 AC 19 ms
8,168 KB
testcase_10 AC 200 ms
8,220 KB
testcase_11 AC 98 ms
8,204 KB
testcase_12 AC 201 ms
8,220 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 16 ms
8,256 KB
testcase_21 WA -
testcase_22 AC 16 ms
8,160 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 20 ms
8,268 KB
testcase_27 WA -
testcase_28 AC 16 ms
8,212 KB
testcase_29 AC 16 ms
8,140 KB
testcase_30 AC 16 ms
8,164 KB
testcase_31 AC 16 ms
8,288 KB
testcase_32 AC 16 ms
8,192 KB
testcase_33 AC 16 ms
8,172 KB
testcase_34 AC 16 ms
8,140 KB
testcase_35 AC 16 ms
8,312 KB
testcase_36 AC 16 ms
8,268 KB
testcase_37 AC 16 ms
8,216 KB
testcase_38 AC 184 ms
8,312 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
l=[[int(j) for j in input().split()]for i in range(n)]
import itertools
ans=0
for i,j in itertools.combinations(range(n),2):
    x1,y1=l[i]
    x2,y2=l[j]
    tmp=0
    if x1-x2==0:
        for x,y in l:
            if x==x1:
                tmp+=1
        ans=max(ans,tmp)
        continue
    a=(y1-y2)/(x1-x2)
    b=y1-a*x1
    for x,y in l:
        if y==int(a*x+b):
            tmp+=1
    ans=max(ans,tmp)

print(ans)
0