結果

問題 No.1041 直線大学
ユーザー ValkyrjaValkyrja
提出日時 2020-05-11 13:48:21
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 272 ms / 2,000 ms
コード長 427 bytes
コンパイル時間 293 ms
コンパイル使用メモリ 10,956 KB
実行使用メモリ 8,312 KB
最終ジャッジ日時 2023-09-25 12:37:30
合計ジャッジ時間 4,188 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,060 KB
testcase_01 AC 17 ms
8,180 KB
testcase_02 AC 16 ms
8,144 KB
testcase_03 AC 17 ms
8,256 KB
testcase_04 AC 16 ms
8,108 KB
testcase_05 AC 16 ms
8,108 KB
testcase_06 AC 18 ms
8,144 KB
testcase_07 AC 21 ms
8,060 KB
testcase_08 AC 21 ms
8,228 KB
testcase_09 AC 21 ms
8,156 KB
testcase_10 AC 259 ms
8,140 KB
testcase_11 AC 101 ms
8,200 KB
testcase_12 AC 272 ms
8,200 KB
testcase_13 AC 26 ms
8,164 KB
testcase_14 AC 122 ms
8,112 KB
testcase_15 AC 36 ms
8,236 KB
testcase_16 AC 93 ms
8,312 KB
testcase_17 AC 18 ms
8,296 KB
testcase_18 AC 48 ms
8,260 KB
testcase_19 AC 94 ms
8,112 KB
testcase_20 AC 16 ms
8,224 KB
testcase_21 AC 53 ms
8,068 KB
testcase_22 AC 16 ms
8,228 KB
testcase_23 AC 204 ms
8,236 KB
testcase_24 AC 111 ms
8,116 KB
testcase_25 AC 57 ms
8,192 KB
testcase_26 AC 21 ms
8,108 KB
testcase_27 AC 34 ms
8,240 KB
testcase_28 AC 16 ms
8,140 KB
testcase_29 AC 16 ms
8,224 KB
testcase_30 AC 16 ms
8,112 KB
testcase_31 AC 16 ms
8,160 KB
testcase_32 AC 16 ms
8,060 KB
testcase_33 AC 16 ms
8,108 KB
testcase_34 AC 16 ms
8,060 KB
testcase_35 AC 16 ms
8,252 KB
testcase_36 AC 16 ms
8,104 KB
testcase_37 AC 17 ms
8,104 KB
testcase_38 AC 241 ms
8,236 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
    for x,y in l:
        if abs((y1-y2)/(x1-x2)*(x-x1)+y1-y)<0.0001:
            tmp+=1
    ans=max(ans,tmp)

print(ans)
0