結果

問題 No.2628 Shrinkage
ユーザー 添え字
提出日時 2024-02-16 21:46:40
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 446 bytes
コンパイル時間 313 ms
コンパイル使用メモリ 82,336 KB
実行使用メモリ 54,576 KB
最終ジャッジ日時 2024-09-28 20:00:35
合計ジャッジ時間 2,005 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 1 WA * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

def same_sign(x, y):
   return (x >= 0) == (y >= 0)


T = int(input())
for i in range(T):
   x1, y1, x2, y2, X1, Y1, X2, Y2 = map(int, input().split())

   P1 = complex(x1, y1)
   P2 = complex(x2, y2)
   Q1 = complex(X1, Y1)
   Q2 = complex(X2, Y2)

   A = P1-P2
   B = Q1-Q2

   if abs(A) > abs(B) and B != 0 and (A/B).imag == 0:
      if same_sign(A.real, B.real) and same_sign(A.imag, B.imag):
         print("Yes")
   else:
      print("No")
0