結果
問題 | No.2564 衝突予測 |
ユーザー |
|
提出日時 | 2023-12-02 16:52:40 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 534 ms / 2,000 ms |
コード長 | 2,324 bytes |
コンパイル時間 | 338 ms |
コンパイル使用メモリ | 82,176 KB |
実行使用メモリ | 78,700 KB |
最終ジャッジ日時 | 2024-09-26 20:49:52 |
合計ジャッジ時間 | 6,405 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 9 |
ソースコード
class Input_kyopro:def II(self): return int(input())def MI(self): return map(int,input().split())def MS(self): return map(str,input().split())def LMI(self): return list(self.MI())def LMS(self): return list(self.MS())def LLI(self,N): return [self.LMI() for _ in range(N)]def LLS(self,N): return [self.LMS() for _ in range(N)]def LS(self,N): return [input() for _ in range(N)]def LSL(self,N): return [list(input()) for _ in range(N)]def LI(self,N): return [self.II() for _ in range(N)]I=Input_kyopro()#入力T=I.II()for _ in range(T):x0,y0,d0=I.MS()x1,y1,d1=I.MS()x0=int(x0)y0=int(y0)x1=int(x1)y1=int(y1)if d0==d1:print('No')elif d0=='U':if d1=='D' and x0==x1 and y0<y1:print('Yes')elif d1=='L':if x1-x0>0 and x1-x0==y1-y0:print('Yes')else:print('No')elif d1=='R':if x0-x1>0 and x0-x1==y1-y0:print('Yes')else:print('No')else:print('No')elif d0=='D':if d1=='U' and x0==x1 and y0>y1:print('Yes')elif d1=='L':if x1-x0>0 and x1-x0==y0-y1:print('Yes')else:print('No')elif d1=='R':if x0-x1>0 and x0-x1==y0-y1:print('Yes')else:print('No')else:print('No')elif d0=='R':if d1=='L' and y0==y1 and x0<x1:print('Yes')elif d1=='D':if y1-y0>0 and y1-y0==x1-x0:print('Yes')else:print('No')elif d1=='U':if y0-y1>0 and y0-y1==x1-x0:print('Yes')else:print('No')else:print('No')elif d0=='L':if d1=='R' and y0==y1 and x0>x1:print('Yes')elif d1=='D':if y1-y0>0 and y1-y0==x0-x1:print('Yes')else:print('No')elif d1=='U':if y0-y1>0 and y0-y1==x0-x1:print('Yes')else:print('No')else:print('No')