結果

問題 No.2564 衝突予測
ユーザー raspberry1729raspberry1729
提出日時 2023-12-02 16:23:28
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 1,319 bytes
コンパイル時間 666 ms
コンパイル使用メモリ 12,160 KB
実行使用メモリ 10,240 KB
最終ジャッジ日時 2023-12-02 16:23:38
合計ジャッジ時間 8,958 ms
ジャッジサーバーID
(参考情報)
judge15 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 24 ms
10,240 KB
testcase_01 AC 25 ms
10,240 KB
testcase_02 AC 25 ms
10,240 KB
testcase_03 AC 771 ms
10,240 KB
testcase_04 AC 781 ms
10,240 KB
testcase_05 AC 783 ms
10,240 KB
testcase_06 AC 778 ms
10,240 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
権限があれば一括ダウンロードができます

ソースコード

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 b-e==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 c-c>0:
			print("Yes")
		else:
			print("No")
	else:
		a=a
0