結果
問題 |
No.245 貫け!
|
ユーザー |
![]() |
提出日時 | 2021-01-02 12:52:54 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 625 bytes |
コンパイル時間 | 224 ms |
コンパイル使用メモリ | 82,396 KB |
実行使用メモリ | 77,692 KB |
最終ジャッジ日時 | 2024-10-12 02:42:57 |
合計ジャッジ時間 | 3,671 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 7 WA * 9 |
ソースコード
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)