結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
53,460 KB
testcase_01 AC 32 ms
53,460 KB
testcase_02 AC 33 ms
53,460 KB
testcase_03 AC 420 ms
78,156 KB
testcase_04 AC 438 ms
78,084 KB
testcase_05 AC 415 ms
77,592 KB
testcase_06 AC 426 ms
78,128 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' and x1 == x2 and y1 < y2:
        print('Yes')
    elif d1 == 'D' and d2 == 'U' and x1 == x2 and y1 > y2:
        print('Yes')
    elif d1 == 'R' and d2 == 'L' and y1 == y2 and x1 < x2:
        print('Yes')
    elif d1 == 'L' and d2 == 'R' and y1 == y2 and x1 > x2:
        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