結果
| 問題 | No.245 貫け! |
| コンテスト | |
| ユーザー |
convexineq
|
| 提出日時 | 2021-01-02 13:08:57 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 185 ms / 5,000 ms |
| コード長 | 531 bytes |
| コンパイル時間 | 628 ms |
| コンパイル使用メモリ | 82,304 KB |
| 実行使用メモリ | 76,364 KB |
| 最終ジャッジ日時 | 2024-10-12 02:56:35 |
| 合計ジャッジ時間 | 3,210 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 16 |
ソースコード
def is_opposit(p0,p1,p2,p3):
x0,y0 = p0; x1,y1 = p1; x2,y2 = p2; x3,y3 = p3
return ((x0-x1)*(y2-y0)+(y0-y1)*(x0-x2))*((x0-x1)*(y3-y0)+(y0-y1)*(x0-x3)) <= 0
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):
if pts[i] == pts[j]: continue
v = sum(is_opposit(pts[i],pts[j],p,q) for p,q in lines)
ans = max(v,ans)
print(ans)
convexineq