結果

問題 No.2564 衝突予測
ユーザー AlgeotAlgeot
提出日時 2023-12-08 01:23:02
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 477 bytes
コンパイル時間 208 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 77,104 KB
最終ジャッジ日時 2023-12-08 01:23:08
合計ジャッジ時間 5,609 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,460 KB
testcase_01 AC 35 ms
53,460 KB
testcase_02 AC 38 ms
53,460 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

T = int(input())
d = {"R": [1, 0], "U": [0, 1], "L": [-1, 0], "D": [0, -1]}
for _ in range(T):
    x1, y1, d1 = map(str, input().split())
    x2, y2, d2 = map(str, input().split())
    x1 = int(x1)
    y1 = int(y1)
    x2 = int(x2)
    y2 = int(y2)
    P = [x1 - x2, y1 - y2]
    A = [0, 0]
    d1 = d[d1]
    d2 = d[d2]
    A[0] = d2[0] - d1[0]
    A[1] = d2[1] - d1[1]
    if P[0] * A[1] == P[1] * A[0] and A[0] * P[0] >= 0:
        print("Yes")
    else:
        print("No")
0