結果

問題 No.2564 衝突予測
ユーザー Basin-Bug
提出日時 2023-12-02 16:11:50
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 475 ms / 2,000 ms
コード長 1,393 bytes
コンパイル時間 223 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 78,116 KB
最終ジャッジ日時 2024-09-26 19:56:32
合計ジャッジ時間 5,780 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #
プレゼンテーションモードにする

T = int(input())
for i in range(T):
x1, y1, d1 = map(str, input().split())
x1 = int(x1)
y1 = int(y1)
x2, y2, d2 = map(str, input().split())
x2 = int(x2)
y2 = int(y2)
if d1 == d2:
print("No")
else:
if d1 == "L" and d2 == "R":
if y1 == y2 and x1 > x2:
print("Yes")
else:
print("No")
elif d1 == "R" and d2 == "L":
if y1 == y2 and x2 > x1:
print("Yes")
else:
print("No")
elif d1 == "U" and d2 == "D":
if x1 == x2 and y2 > y1:
print("Yes")
else:
print("No")
elif d2 == "U" and d1 == "D":
if x1 == x2 and y1 > y2:
print("Yes")
else:
print("No")
else:
if (d1 == "L" and d2 == "U") or (d1 == "D" and d2 == "R"):
if y1 - y2 == x1 - x2 and y1 - y2 >= 0:
print("Yes")
else:
print("No")
elif (d1 == "L" and d2 == "D") or (d1 == "U" and d2 == "R"):
if x1 - x2 == y2 - y1 and y2 - y1 >= 0:
print("Yes")
else:
print("No")
elif (d1 == "R" and d2 == "U") or (d1 == "D" and d2 == "L"):
if x2 - x1 == y1 - y2 and y1 - y2 >= 0:
print("Yes")
else:
print("No")
elif (d1 == "R" and d2 == "D") or(d1 == "U" and d2 == "L"):
if x2 - x1 == y2 - y1 and y2 - y1 >= 0:
print("Yes")
else:
print("No")
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0