結果

問題 No.1041 直線大学
ユーザー Omura ShunsukeOmura Shunsuke
提出日時 2020-05-02 15:11:50
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 96 ms / 2,000 ms
コード長 722 bytes
コンパイル時間 1,126 ms
コンパイル使用メモリ 86,692 KB
実行使用メモリ 77,308 KB
最終ジャッジ日時 2023-08-28 18:16:46
合計ジャッジ時間 4,991 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,368 KB
testcase_01 AC 66 ms
71,204 KB
testcase_02 AC 69 ms
71,228 KB
testcase_03 AC 68 ms
71,520 KB
testcase_04 AC 69 ms
71,184 KB
testcase_05 AC 68 ms
71,412 KB
testcase_06 AC 69 ms
71,036 KB
testcase_07 AC 70 ms
71,312 KB
testcase_08 AC 71 ms
71,260 KB
testcase_09 AC 73 ms
71,348 KB
testcase_10 AC 84 ms
76,616 KB
testcase_11 AC 86 ms
76,792 KB
testcase_12 AC 85 ms
76,508 KB
testcase_13 AC 82 ms
76,660 KB
testcase_14 AC 96 ms
76,700 KB
testcase_15 AC 83 ms
76,708 KB
testcase_16 AC 88 ms
76,536 KB
testcase_17 AC 70 ms
71,276 KB
testcase_18 AC 87 ms
76,472 KB
testcase_19 AC 88 ms
76,564 KB
testcase_20 AC 70 ms
71,360 KB
testcase_21 AC 86 ms
76,680 KB
testcase_22 AC 69 ms
71,204 KB
testcase_23 AC 96 ms
77,308 KB
testcase_24 AC 91 ms
76,628 KB
testcase_25 AC 89 ms
76,628 KB
testcase_26 AC 72 ms
71,344 KB
testcase_27 AC 85 ms
76,504 KB
testcase_28 AC 72 ms
71,204 KB
testcase_29 AC 69 ms
71,468 KB
testcase_30 AC 69 ms
71,056 KB
testcase_31 AC 67 ms
71,232 KB
testcase_32 AC 67 ms
71,464 KB
testcase_33 AC 66 ms
71,432 KB
testcase_34 AC 67 ms
71,060 KB
testcase_35 AC 68 ms
71,320 KB
testcase_36 AC 68 ms
71,472 KB
testcase_37 AC 69 ms
71,356 KB
testcase_38 AC 90 ms
76,668 KB
権限があれば一括ダウンロードができます

ソースコード

diff #


def line(x1,y1,x2,y2):
    if x1==x2:
        return ("I",x1)
    elif y1==y2:
        return (y1,"I")
    else:
        #Y=aX+b
        a=(y1-y2)/(x1-x2)
        return (int((y1-(a*x1))*10**5),int(a*10**5))

N=int(input())
L=[]
D={}
for i in range(N):
    x,y=map(int,input().split())
    L.append([x,y])

for i in range(N):
    for j in range(N):
        if i==j:
            continue
        else:
            if line(L[i][0],L[i][1],L[j][0],L[j][1]) not in D:
                D[line(L[i][0],L[i][1],L[j][0],L[j][1])]=1
            else:
                D[line(L[i][0],L[i][1],L[j][0],L[j][1])]+=1
Max=max(D.values())
#print(D)
#print(Max)
for i in range(1,10**3):
    if i*(i-1)==Max:
        print(i)
        exit()
0