結果

問題 No.2564 衝突予測
ユーザー Lucagon
提出日時 2023-12-02 15:31:38
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 694 bytes
コンパイル時間 515 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 77,824 KB
最終ジャッジ日時 2024-09-26 18:50:22
合計ジャッジ時間 5,456 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 4 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

t = int(input())

for i in range(t):
    a = list(input().split())
    b = list(input().split())
    x1,y1,d1 = int(a[0]),int(a[1]),a[2]
    x2,y2,d2 = int(b[0]),int(b[1]),b[2]
    flag = False

    if x1 == x2:
        if ((y1 > y2 and d1 == "D" and d2 == "U") or
            (y1 < y2 and d1 == "U" and d2 == "D")):
            flag = True
    if y1 == y2:
        if ((x1 > x2 and d1 == "L" and d2 == "R") or
            (x1 < x2 and d1 == "R" and d2 == "L")):
            flag = True
    if abs(x1 - x2) == abs(y1 - y2):
        if ((x1 > x2 and (d1 == "L" or d2 == "R")) or
            (x1 < x2 and (d1 == "R" or d2 == "L"))):
            flag = True
    
    print("Yes" if flag else "No")
0