結果

問題 No.2564 衝突予測
ユーザー NullzNullz
提出日時 2023-12-02 16:24:04
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 893 bytes
コンパイル時間 179 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 78,468 KB
最終ジャッジ日時 2023-12-02 16:24:12
合計ジャッジ時間 5,014 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

c = {'R': (1, 0), 'L': (-1, 0), 'U': (0, 1), 'D': (0, -1)}
for _ in range(int(input())):
    x1, y1, d1 = input().split()
    x2, y2, d2 = input().split()
    x1, x2, y1, y2 = int(x1), int(x2), int(y1), int(y2)
    if ((d1 == 'U' and d2 == 'D') or ((d1 == 'D') and (d2 == 'U'))) and x1 == x2:
        print('Yes')
    elif ((d1 == 'R' and d2 == 'L') or ((d1 == 'L') and (d2 == 'R'))) and y1 == y2:
        print('Yes')
    elif ((d1 == 'U' and d2 == 'R') or (d1 == 'L' and d2 == 'D')) and x1 - x2 == y2 - y1:
        print('Yes')
    elif ((d1 == 'U' and d2 == 'L') or (d1 == 'R' and d2 == 'D')) and x2 - x1 == y2 - y1:
        print('Yes')
    elif ((d1 == 'D' and d2 == 'R') or (d1 == 'L' and d2 == 'U')) and x1 - x2 == y1 - y2:
        print('Yes')
    elif ((d1 == 'D' and d2 == 'L') or (d1 == 'R' and d2 == 'U')) and x2 - x1 == y1 - y2:
        print('Yes')
    else:
        print('No')
0