結果
| 問題 |
No.622 点と三角柱の内外判定
|
| コンテスト | |
| ユーザー |
👑 Kazun
|
| 提出日時 | 2021-02-19 02:58:47 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 834 bytes |
| コンパイル時間 | 360 ms |
| コンパイル使用メモリ | 81,920 KB |
| 実行使用メモリ | 52,480 KB |
| 最終ジャッジ日時 | 2024-09-15 07:27:12 |
| 合計ジャッジ時間 | 2,946 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 29 WA * 3 |
ソースコード
class P:
def __init__(self,x,y,z):
self.x=x
self.y=y
self.z=z
def __str__(self):
return "({}, {}, {})".format(self.x,self.y,self.z)
def __repr__(self):
return str(self)
def __neg__(self):
return P(-self.x,-self.y,-self.z)
def __sub__(self,other):
return P(self.x-other.x,self.y-other.y,self.z-other.z)
def __mul__(self,other):
return self.x*other.x+self.y*other.y+self.z*other.z
#================================================
A=P(*tuple(map(int,input().split())))
B=P(*tuple(map(int,input().split())))
C=P(*tuple(map(int,input().split())))
D=P(*tuple(map(int,input().split())))
p=B-A;q=C-A
a=p*p;b=c=p*q;d=q*q
s=(D-A)*p;t=(D-A)*q
det=a*d-b*c
alpha=(d*s-b*t)/det
beta =(-c*s+a*t)/det
print("YES" if 0<=alpha<=1 and 0<=beta<=1 else "NO")
Kazun