結果

問題 No.622 点と三角柱の内外判定
ユーザー maspymaspy
提出日時 2020-02-03 13:07:19
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 475 bytes
コンパイル時間 343 ms
コンパイル使用メモリ 11,912 KB
実行使用メモリ 42,508 KB
最終ジャッジ日時 2023-10-19 01:43:06
合計ジャッジ時間 18,367 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 471 ms
42,500 KB
testcase_01 AC 474 ms
42,500 KB
testcase_02 AC 469 ms
42,500 KB
testcase_03 AC 469 ms
42,500 KB
testcase_04 AC 468 ms
42,500 KB
testcase_05 AC 471 ms
42,500 KB
testcase_06 AC 470 ms
42,500 KB
testcase_07 AC 470 ms
42,500 KB
testcase_08 AC 467 ms
42,500 KB
testcase_09 AC 475 ms
42,500 KB
testcase_10 AC 472 ms
42,500 KB
testcase_11 AC 477 ms
42,500 KB
testcase_12 AC 476 ms
42,500 KB
testcase_13 AC 473 ms
42,500 KB
testcase_14 AC 476 ms
42,500 KB
testcase_15 AC 473 ms
42,500 KB
testcase_16 AC 471 ms
42,500 KB
testcase_17 AC 468 ms
42,500 KB
testcase_18 WA -
testcase_19 AC 499 ms
42,500 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 468 ms
42,500 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 472 ms
42,500 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

import numpy as np

data = np.array(read().split(), np.int64)

A,B,C,D = [data[3*i:3*i+3] for i in range(4)]

def test(A,B,C,D):
    v = np.cross(B-A, C-A)
    n = np.cross(B-A, v)
    return np.sign(np.dot(n,C-A)) == np.sign(np.dot(n,D-A))

bl = True
for _ in range(3):
    A,B,C = B,C,A
    bl &= test(A,B,C,D)

answer = 'YES' if bl else 'NO'
print(answer)
0