結果

問題 No.2564 衝突予測
ユーザー raspberry1729
提出日時 2023-12-02 16:30:36
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 1,319 bytes
コンパイル時間 104 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2024-09-26 20:22:51
合計ジャッジ時間 9,899 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 4 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

a=int(input())
for i in range(a):
	b,c,d=input().split()
	b,c=int(b),int(c)
	e,f,g=input().split()
	e,f=int(e),int(f)
	if d==g:
		print("No")
		continue
	if (d=="U" and g=="D"):
		if b==e and f-c>0:
			print("Yes")
		else:
			print("No")
	elif (d=="D" and g=="U"):
		if b==e and c-f>0:
			print("Yes")
		else:
			print("No")
	elif (d=="R" and g=="L"):
		if c==f and e-b>0:
			print("Yes")
		else:
			print("No")
	elif (d=="L" and g=="R"):
		if c==f and b>e>0:
			print("Yes")
		else:
			print("No")
	elif (d=="U" and g=="L"):
		if e-b==f-c and e-b>0 and f-c>0:
			print("Yes")
		else:
			print("No")
	elif (d=="L" and g=="U"):
		if e-b==f-c and b-e>0 and c-f>0:
			print("Yes")
		else:
			print("No")
	elif (d=="U" and g=="R"):
		if e-b==c-f and b-e>0 and f-c>0:
			print("Yes")
		else:
			print("No")
	elif (d=="R" and g=="U"):
		if e-b==c-f and e-b>0 and c-f>0:
			print("Yes")
		else:
			print("No")
	elif (d=="R" and g=="D"):
		if e-b==f-c and e-b>0 and f-c>0:
			print("Yes")
		else:
			print("No")
	elif (d=="D" and g=="R"):
		if b-e==c-f and b-e>0 and c-f>0:
			print("Yes")
		else:
			print("No")
	elif (d=="D" and g=="L"):
		if e-b==c-f and e-b>0 and c-f>0:
			print("Yes")
		else:
			print("No")
	elif (d=="L" and g=="D"):
		if b-e==f-c and b-e>0 and f-c>0:
			print("Yes")
		else:
			print("No")
	else:
		a=a
0