結果
問題 | No.2564 衝突予測 |
ユーザー | e60e256 |
提出日時 | 2023-12-02 16:35:06 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 585 ms / 2,000 ms |
コード長 | 3,515 bytes |
コンパイル時間 | 317 ms |
コンパイル使用メモリ | 82,176 KB |
実行使用メモリ | 79,288 KB |
最終ジャッジ日時 | 2024-09-26 20:28:24 |
合計ジャッジ時間 | 6,794 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 42 ms
52,224 KB |
testcase_01 | AC | 43 ms
52,096 KB |
testcase_02 | AC | 44 ms
52,224 KB |
testcase_03 | AC | 561 ms
78,664 KB |
testcase_04 | AC | 569 ms
78,316 KB |
testcase_05 | AC | 559 ms
78,220 KB |
testcase_06 | AC | 561 ms
78,580 KB |
testcase_07 | AC | 561 ms
78,356 KB |
testcase_08 | AC | 568 ms
77,968 KB |
testcase_09 | AC | 573 ms
78,920 KB |
testcase_10 | AC | 574 ms
79,288 KB |
testcase_11 | AC | 585 ms
78,784 KB |
ソースコード
T = int(input()) for t in range(T): x1, y1, d1 = input().split() x1 = int(x1) y1 = int(y1) x2, y2, d2 = input().split() x2 = int(x2) y2 = int(y2) if (d1 == d2): print("No") else: if (d1 == "U" and d2 == "D"): if (x1 == x2): collision_time = (y2 - y1) // 2 if (collision_time < 0): print("No") else: print("Yes") else: print("No") elif (d1 == "D" and d2 == "U"): if (x1 == x2): collision_time = (y1 - y2) // 2 if (collision_time < 0): print("No") else: print("Yes") else: print("No") elif (d1 == "R" and d2 == "L"): if (y1 == y2): collision_time = (x2 - x1) // 2 if (collision_time < 0): print("No") else: print("Yes") else: print("No") elif (d1 == "L" and d2 == "R"): if (y1 == y2): collision_time = (x1 - x2) // 2 if (collision_time < 0): print("No") else: print("Yes") else: print("No") if (d1 == "U" and d2 == "R"): if (x2 < x1 and y1 < y2): if (abs(x2 - x1) == abs(y2 - y1)): print("Yes") else: print("No") else: print("No") if (d1 == "R" and d2 == "U"): if (x1 < x2 and y2 < y1): if (abs(x2 - x1) == abs(y2 - y1)): print("Yes") else: print("No") else: print("No") if (d1 == "D" and d2 == "R"): if (x2 < x1 and y1 > y2): if (abs(x2 - x1) == abs(y2 - y1)): print("Yes") else: print("No") else: print("No") if (d1 == "R" and d2 == "D"): if (x1 < x2 and y2 > y1): if (abs(x2 - x1) == abs(y2 - y1)): print("Yes") else: print("No") else: print("No") if (d1 == "U" and d2 == "L"): if (x1 < x2 and y1 < y2): if (abs(x2 - x1) == abs(y2 - y1)): print("Yes") else: print("No") else: print("No") if (d1 == "L" and d2 == "U"): if (x2 < x1 and y2 < y1): if (abs(x2 - x1) == abs(y2 - y1)): print("Yes") else: print("No") else: print("No") if (d1 == "D" and d2 == "L"): if (x2 > x1 and y1 > y2): if (abs(x2 - x1) == abs(y2 - y1)): print("Yes") else: print("No") else: print("No") if (d1 == "L" and d2 == "D"): if (x1 > x2 and y2 > y1): if (abs(x2 - x1) == abs(y2 - y1)): print("Yes") else: print("No") else: print("No")