結果
問題 |
No.2564 衝突予測
|
ユーザー |
|
提出日時 | 2023-12-02 16:19:53 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,171 bytes |
コンパイル時間 | 436 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 11,008 KB |
最終ジャッジ日時 | 2024-09-26 20:08:53 |
合計ジャッジ時間 | 10,771 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 4 WA * 5 |
ソースコード
a=int(input()) for i in range(a): b,c,d=input().split() b,c=int(b),int(c) e,f,g=input().split() e,f=int(e),int(f) if d==g: print("No") continue if (d=="U" and g=="D") or (d=="D" and g=="U"): if b==e: print("Yes") else: print("No") elif (d=="R" and g=="L") or (d=="L" and g=="R"): if c==f: print("Yes") else: print("No") elif (d=="U" and g=="L"): if e-b==f-c and e-b>0 and f-c>0: print("Yes") else: print("No") elif (d=="L" and g=="U"): if e-b==f-c and b-e>0 and c-f>0: print("Yes") else: print("No") elif (d=="U" and g=="R"): if e-b==c-f and b-e>0 and f-c>0: print("Yes") else: print("No") elif (d=="R" and g=="U"): if b-e==c-f and e-b>0 and c-f>0: print("Yes") else: print("No") elif (d=="R" and g=="D"): if e-b==f-c and e-b>0 and f-c>0: print("Yes") else: print("No") elif (d=="D" and g=="R"): if b-e==c-f and b-e>0 and c-f>0: print("Yes") else: print("No") elif (d=="D" and g=="L"): if e-b==c-f and e-b>0 and c-f>0: print("Yes") else: print("No") elif (d=="L" and g=="D"): if b-e==f-c and b-e>0 and c-c>0: print("Yes") else: print("No") else: a=a