結果
| 問題 |
No.2564 衝突予測
|
| コンテスト | |
| ユーザー |
kinoko_econ
|
| 提出日時 | 2023-12-02 16:03:03 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 2,116 bytes |
| コンパイル時間 | 471 ms |
| コンパイル使用メモリ | 82,304 KB |
| 実行使用メモリ | 78,252 KB |
| 最終ジャッジ日時 | 2024-09-26 19:45:30 |
| 合計ジャッジ時間 | 5,713 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 4 WA * 5 |
ソースコード
T = int(input())
for i in range(T):
x, y, d = input().split()
x, y = int(x), int(y)
a, b, s = input().split()
a, b = int(a), int(b)
if d == 'U':
if s == 'U':
if x == a and y == b:
print('Yes')
else: print('No')
elif s == 'D':
if x == a and y <= b:
print('Yes')
else: print('No')
elif s == 'R':
if x-a == b-y and b-y >= 0:
print('Yes')
else: print('No')
else:
if x+a == b-y and b-y >= 0:
print('Yes')
else: print('No')
elif d == 'D':
if s == 'D':
if x == a and y == b:
print('Yes')
else: print('No')
elif s == 'U':
if x == a and y >= b:
print('Yes')
else: print('No')
elif s == 'R':
if x-a == y-b and y-b >= 0:
print('Yes')
else: print('No')
else:
if a-x == y-b and b-y <= 0:
print('Yes')
else: print('No')
elif d == 'R':
if s == 'R':
if x == a and y == b:
print('Yes')
else: print('No')
elif s == 'L':
if y == b and x <= a:
print('Yes')
else: print('No')
elif s == 'U':
if a-x == y-b and y-b >= 0:
print('Yes')
else: print('No')
else:
if a-x == b-y and b-y >= 0:
print('Yes')
else: print('No')
else:
if s == 'L':
if x == a and y == b:
print('Yes')
else: print('No')
elif s == 'R':
if y == b and x >= a:
print('Yes')
else: print('No')
elif s == 'U':
if x-a == y-b and y-b >= 0:
print('Yes')
else: print('No')
else:
if x-a == b-y and b-y >= 0:
print('Yes')
else: print('No')
kinoko_econ