結果

問題 No.2564 衝突予測
ユーザー ゼットゼット
提出日時 2023-12-21 00:13:14
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 772 bytes
コンパイル時間 299 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 79,688 KB
最終ジャッジ日時 2023-12-21 00:13:21
合計ジャッジ時間 6,866 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

Q=int(input())
for _ in range(Q):
  x1,y1,d1=input().split()
  x2,y2,d2=input().split()
  x1=int(x1)
  x2=int(x2)
  y1=int(y1)
  y2=int(y2)
  L=[[1,0],[-1,0],[0,1],[0,-1]]
  s='RLUD'
  T={}
  for i in range(4):
    T[s[i]]=i
  v=[0]*2
  k=L[T[d2]]
  for j in range(2):
    v[j]+=k[j]
  k=L[T[d1]]
  for j in range(2):
    v[j]-=k[j]
  if v[0]==0 and v[1]==0:
    print('No')
    continue
  if v[0]==0:
    time=(y1-y2)/(v[1])
    if time>0:
      print('Yes')
    else:
      print('No')
  elif v[1]==0:
    time=(x1-x2)/(v[0])
    if time>0:
      print('Yes')
    else:
      print('No')
  else:
    time1=(x1-x2)//(v[0])
    time2=(y1-y2)//(v[1])
    if time1!=time2:
      print('No')
    else:
      if time1>0:
        print('Yes')
      else:
        print('No')
  
0