結果

問題 No.2564 衝突予測
ユーザー kinoko_econkinoko_econ
提出日時 2023-12-02 15:52:56
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 809 bytes
コンパイル時間 166 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 77,124 KB
最終ジャッジ日時 2023-12-02 15:53:01
合計ジャッジ時間 5,068 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
53,460 KB
testcase_01 AC 35 ms
53,460 KB
testcase_02 AC 34 ms
53,460 KB
testcase_03 AC 411 ms
77,120 KB
testcase_04 AC 424 ms
76,996 KB
testcase_05 AC 399 ms
76,992 KB
testcase_06 AC 402 ms
76,996 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

T = int(input())
dic = {'U':2, 'R':1, 'D':0, 'L':-1}
for i 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 (dic[d1]%2)*dic[d1] - (dic[d2]%2)*dic[d2] == 0:
        if x1 == x2:
            if ((dic[d1]-1)%2)*(dic[d1]-1) - ((dic[d2]-1)%2)*(dic[d2]-1) == 0:
                if y1 == y2:
                    print('Yes')
                else:
                    print('No')
            else:
                print('Yes')
        else:
            print('No')
    else:
        t = (x2-x1)/((dic[d1]%2)*dic[d1] - (dic[d2]%2)*dic[d2])
        if y1 + (dic[d1]-1)%2*(dic[d1]-1)*t == y2 + ((dic[d2]-1)%2)*(dic[d2]-1)*t:
            print('Yes')
        else:
            print('No')
    
        

            



    
0