結果

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

テストケース

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

ソースコード

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