結果

問題 No.622 点と三角柱の内外判定
ユーザー 👑 KazunKazun
提出日時 2021-02-19 02:58:47
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 834 bytes
コンパイル時間 454 ms
コンパイル使用メモリ 87,088 KB
実行使用メモリ 71,720 KB
最終ジャッジ日時 2023-10-13 10:21:41
合計ジャッジ時間 4,162 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,104 KB
testcase_01 WA -
testcase_02 AC 73 ms
71,336 KB
testcase_03 WA -
testcase_04 AC 74 ms
71,404 KB
testcase_05 AC 70 ms
71,196 KB
testcase_06 AC 72 ms
71,400 KB
testcase_07 AC 69 ms
71,520 KB
testcase_08 WA -
testcase_09 AC 69 ms
71,340 KB
testcase_10 AC 67 ms
71,228 KB
testcase_11 AC 69 ms
71,328 KB
testcase_12 AC 68 ms
71,540 KB
testcase_13 AC 69 ms
71,120 KB
testcase_14 AC 69 ms
71,300 KB
testcase_15 AC 69 ms
71,420 KB
testcase_16 AC 68 ms
71,332 KB
testcase_17 AC 68 ms
71,200 KB
testcase_18 AC 69 ms
71,340 KB
testcase_19 AC 66 ms
71,308 KB
testcase_20 AC 68 ms
71,396 KB
testcase_21 AC 68 ms
71,244 KB
testcase_22 AC 70 ms
71,120 KB
testcase_23 AC 67 ms
71,312 KB
testcase_24 AC 68 ms
71,356 KB
testcase_25 AC 68 ms
71,360 KB
testcase_26 AC 66 ms
71,140 KB
testcase_27 AC 66 ms
71,608 KB
testcase_28 AC 68 ms
71,572 KB
testcase_29 AC 70 ms
71,296 KB
testcase_30 AC 67 ms
71,308 KB
testcase_31 AC 66 ms
71,472 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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")
0