結果

問題 No.1041 直線大学
ユーザー stngstng
提出日時 2020-05-01 21:53:01
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 753 bytes
コンパイル時間 149 ms
コンパイル使用メモリ 10,968 KB
実行使用メモリ 7,968 KB
最終ジャッジ日時 2023-08-26 09:24:23
合計ジャッジ時間 3,175 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,904 KB
testcase_01 AC 16 ms
7,824 KB
testcase_02 AC 16 ms
7,844 KB
testcase_03 AC 16 ms
7,792 KB
testcase_04 AC 16 ms
7,844 KB
testcase_05 AC 16 ms
7,828 KB
testcase_06 AC 16 ms
7,848 KB
testcase_07 AC 18 ms
7,908 KB
testcase_08 AC 18 ms
7,852 KB
testcase_09 AC 18 ms
7,840 KB
testcase_10 AC 117 ms
7,828 KB
testcase_11 AC 58 ms
7,748 KB
testcase_12 AC 118 ms
7,840 KB
testcase_13 AC 21 ms
7,844 KB
testcase_14 AC 63 ms
7,908 KB
testcase_15 AC 25 ms
7,744 KB
testcase_16 AC 48 ms
7,832 KB
testcase_17 WA -
testcase_18 AC 30 ms
7,840 KB
testcase_19 AC 51 ms
7,828 KB
testcase_20 AC 16 ms
7,820 KB
testcase_21 AC 33 ms
7,788 KB
testcase_22 AC 16 ms
7,744 KB
testcase_23 AC 98 ms
7,824 KB
testcase_24 AC 56 ms
7,800 KB
testcase_25 AC 34 ms
7,832 KB
testcase_26 AC 19 ms
7,844 KB
testcase_27 AC 23 ms
7,788 KB
testcase_28 AC 17 ms
7,920 KB
testcase_29 AC 16 ms
7,820 KB
testcase_30 AC 16 ms
7,804 KB
testcase_31 AC 17 ms
7,956 KB
testcase_32 AC 16 ms
7,792 KB
testcase_33 AC 16 ms
7,912 KB
testcase_34 AC 16 ms
7,792 KB
testcase_35 AC 16 ms
7,900 KB
testcase_36 AC 16 ms
7,812 KB
testcase_37 AC 16 ms
7,968 KB
testcase_38 AC 113 ms
7,828 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
xy = [[int(i) for i in input().split()] for j in range(n)]

ans = 0

for i in range(n):
    for j in range(i+1,n):
        if xy[i][0] == xy[j][0]:
            flag = True
            K = 0
            b = 0
        else:
            flag = False
            b = xy[i][1] - xy[i][0] * (xy[i][1]-xy[j][1]) / (xy[i][0]-xy[j][0])
            #K = (xy[i][1]-xy[j][1]) / (xy[i][0]-xy[j][0])
        tmp = 2
        #print(K,b,i,j)
        for k in range(j+1,n):
            if flag == True:
                if xy[k][0] == xy[i][0]:
                    tmp += 1
            elif xy[k][1] == (xy[i][1]-xy[j][1]) / (xy[i][0]-xy[j][0])*xy[k][0]+b:
                tmp += 1
            #print(i,j,k)
        ans = max(ans,tmp)
        
print(ans)
0