結果

問題 No.2564 衝突予測
ユーザー hirayuu_ychirayuu_yc
提出日時 2023-12-02 15:06:53
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 373 ms / 2,000 ms
コード長 558 bytes
コンパイル時間 161 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 76,232 KB
最終ジャッジ日時 2023-12-02 15:07:04
合計ジャッジ時間 4,511 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
53,460 KB
testcase_01 AC 32 ms
53,460 KB
testcase_02 AC 32 ms
53,460 KB
testcase_03 AC 337 ms
75,972 KB
testcase_04 AC 329 ms
75,976 KB
testcase_05 AC 346 ms
75,976 KB
testcase_06 AC 327 ms
75,972 KB
testcase_07 AC 321 ms
75,976 KB
testcase_08 AC 331 ms
75,976 KB
testcase_09 AC 343 ms
76,232 KB
testcase_10 AC 373 ms
76,232 KB
testcase_11 AC 337 ms
76,232 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

T=int(input())
di="LDRU"*2
for i in range(T):
    x1,y1,d1=input().split()
    x2,y2,d2=input().split()
    x1=int(x1)
    y1=int(y1)
    x2=int(x2)
    y2=int(y2)
    ans="No"
    for j in range(4):
        x1,y1=-y1,x1
        x2,y2=-y2,x2
        d1=di[di.find(d1)+1]
        d2=di[di.find(d2)+1]
        if y1==y2 and x1<x2 and d1=="R" and d2=="L":
            ans="Yes"
        if x1-y1==x2-y2:
            if x1<x2 and d1=="R" and d2=="D":
                ans="Yes"
            if x2<x1 and d2=="R" and d1=="D":
                ans="Yes"
    print(ans)
0