結果

問題 No.245 貫け!
ユーザー convexineqconvexineq
提出日時 2021-01-02 12:52:54
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 625 bytes
コンパイル時間 294 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 77,692 KB
最終ジャッジ日時 2024-04-20 07:33:57
合計ジャッジ時間 3,616 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
52,224 KB
testcase_01 AC 42 ms
52,096 KB
testcase_02 AC 41 ms
52,352 KB
testcase_03 AC 43 ms
52,224 KB
testcase_04 AC 39 ms
52,352 KB
testcase_05 AC 39 ms
52,864 KB
testcase_06 AC 39 ms
52,992 KB
testcase_07 AC 37 ms
52,224 KB
testcase_08 AC 72 ms
72,320 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 210 ms
76,932 KB
testcase_16 WA -
testcase_17 AC 216 ms
77,312 KB
testcase_18 WA -
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

def is_opposit(p0,p1,p2,p3):
    x0,y0 = p0; x1,y1 = p1; x2,y2 = p2; x3,y3 = p3
    if ((x0-x1)*(y2-y0)+(y0-y1)*(x0-x2))*((x0-x1)*(y3-y0)+(y0-y1)*(x0-x3)) > 0:
        return False
    else:
        return True

def is_crossed(p0,p1,p2,p3):
    return is_opposit(p0,p1,p2,p3) and is_opposit(p2,p3,p0,p1)

n = int(input())
pts = []
lines = []
for _ in range(n):
    a,b,c,d = map(int,input().split())
    lst = [(a,b),(c,d)]
    pts += lst
    lines += [lst]

ans = 0
L = len(pts)
for i in range(L):
    for j in range(i+1,L):
        v = sum(is_crossed(pts[i],pts[j],p,q) for p,q in lines)
        ans = max(v,ans)
print(ans)
0