結果
問題 |
No.2564 衝突予測
|
ユーザー |
|
提出日時 | 2024-06-07 14:09:58 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 678 bytes |
コンパイル時間 | 1,562 ms |
コンパイル使用メモリ | 81,792 KB |
実行使用メモリ | 78,712 KB |
最終ジャッジ日時 | 2024-12-25 19:01:14 |
合計ジャッジ時間 | 10,078 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | WA * 9 |
ソースコード
T = int(input()) tate = ('U', 'D') yoko = ('L', 'R') for _ in range(T): x1, y1, d1 = input().split() x1, y1 = int(x1), int(y1) x2, y2, d2 = input().split() x2, y2 = int(x2), int(y2) if x1 > x2 or (x1 == x2 and y1 > y2): x1, y1, d1, x2, y2, d2 = x2, y2, d2, x1, y1, d1 if d1 == 'L' or d2 == 'R': print('No') continue if y1 < y2 and (d1 == 'D' or d2 == 'U'): print('No') continue if d1 in tate and d2 in tate: print('Yes') continue if d1 in yoko and d2 in yoko: print('Yes') continue if abs(x1 - x2) == abs(y1 - y2): print('Yes') else: print('No')