結果
| 問題 |
No.245 貫け!
|
| コンテスト | |
| ユーザー |
titia
|
| 提出日時 | 2022-08-11 00:45:12 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 522 bytes |
| コンパイル時間 | 92 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2024-09-21 10:13:30 |
| 合計ジャッジ時間 | 10,364 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 15 WA * 1 |
ソースコード
# 交差判定には外積を使うんだったよなー、と思って解説を見た。
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)
print(ANS)
titia