結果
問題 | No.2564 衝突予測 |
ユーザー | titia |
提出日時 | 2023-12-13 07:48:43 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
AC
|
実行時間 | 949 ms / 2,000 ms |
コード長 | 1,957 bytes |
コンパイル時間 | 551 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-09-27 05:13:06 |
合計ジャッジ時間 | 9,928 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 27 ms
10,880 KB |
testcase_01 | AC | 28 ms
10,880 KB |
testcase_02 | AC | 27 ms
10,880 KB |
testcase_03 | AC | 913 ms
10,752 KB |
testcase_04 | AC | 886 ms
10,880 KB |
testcase_05 | AC | 886 ms
10,752 KB |
testcase_06 | AC | 921 ms
10,880 KB |
testcase_07 | AC | 913 ms
10,880 KB |
testcase_08 | AC | 914 ms
10,880 KB |
testcase_09 | AC | 908 ms
10,880 KB |
testcase_10 | AC | 949 ms
10,752 KB |
testcase_11 | AC | 904 ms
10,880 KB |
ソースコード
T=int(input()) for tests in range(T): x1,y1,d1=input().split() x2,y2,d2=input().split() x1=int(x1) x2=int(x2) y1=int(y1) y2=int(y2) if d1==d2: print("No") continue if d1=="U" and d2=="D": if x1==x2 and y1<=y2: print("Yes") else: print("No") elif d1=="D" and d2=="U": if x1==x2 and y1>=y2: print("Yes") else: print("No") elif d1=="R" and d2=="L": if x1<=x2 and y1==y2: print("Yes") else: print("No") elif d1=="L" and d2=="R": if x1>=x2 and y1==y2: print("Yes") else: print("No") elif d1=="U" and d2=="R": if y1<=y2 and x1>=x2 and abs(x1-x2)==abs(y1-y2): print("Yes") else: print("No") elif d1=="U" and d2=="L": if y1<=y2 and x1<=x2 and abs(x1-x2)==abs(y1-y2): print("Yes") else: print("No") elif d1=="D" and d2=="R": if y1>=y2 and x1>=x2 and abs(x1-x2)==abs(y1-y2): print("Yes") else: print("No") elif d1=="D" and d2=="L": if y1>=y2 and x1<=x2 and abs(x1-x2)==abs(y1-y2): print("Yes") else: print("No") elif d1=="R" and d2=="U": if y1>=y2 and x1<=x2 and abs(x1-x2)==abs(y1-y2): print("Yes") else: print("No") elif d1=="R" and d2=="D": if y1<=y2 and x1<=x2 and abs(x1-x2)==abs(y1-y2): print("Yes") else: print("No") elif d1=="L" and d2=="U": if y1>=y2 and x1>=x2 and abs(x1-x2)==abs(y1-y2): print("Yes") else: print("No") elif d1=="L" and d2=="D": if y1<=y2 and x1>=x2 and abs(x1-x2)==abs(y1-y2): print("Yes") else: print("No")