結果
| 問題 | No.245 貫け! |
| コンテスト | |
| ユーザー |
titia
|
| 提出日時 | 2022-08-11 00:56:15 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
AC
|
| 実行時間 | 1,450 ms / 5,000 ms |
| コード長 | 804 bytes |
| 記録 | |
| コンパイル時間 | 531 ms |
| コンパイル使用メモリ | 20,868 KB |
| 実行使用メモリ | 15,484 KB |
| 最終ジャッジ日時 | 2026-04-09 16:48:28 |
| 合計ジャッジ時間 | 15,111 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 16 |
ソースコード
# 交差判定には外積を使うんだったよなー、と思って解説を見た。
N=int(input())
A=[tuple(map(int,input().split())) for i in range(N)]
def outer_product(x,y,z,w):
return x*w-y*z
ANS=0
for x,y,_,_ in A:
for _,_,z,w in A:
if x==z and y==w:
continue
score=0
for p,q,r,s in A:
if outer_product(z-x,w-y,p-x,q-y)*outer_product(z-x,w-y,r-x,s-y)<=0:
score+=1
ANS=max(ANS,score)
for x,y,_,_ in A:
for z,w,_,_ in A:
if x==z and y==w:
continue
score=0
for p,q,r,s in A:
if outer_product(z-x,w-y,p-x,q-y)*outer_product(z-x,w-y,r-x,s-y)<=0:
score+=1
ANS=max(ANS,score)
print(ANS)
titia