結果

問題 No.2628 Shrinkage
コンテスト
ユーザー ニックネーム
提出日時 2024-02-16 23:39:59
言語 Python3
(3.14.3 + numpy 2.4.4 + scipy 1.17.1)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
WA  
実行時間 -
コード長 408 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 369 ms
コンパイル使用メモリ 20,696 KB
実行使用メモリ 20,572 KB
最終ジャッジ日時 2026-04-15 10:55:52
合計ジャッジ時間 5,185 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 4 WA * 17 RE * 7
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

for _ in range(int(input())):
    a,b,c,d,e,f,g,h = map(int,input().split())
    i,j,k,l = e-a,f-b,g-c,h-d
    if i*l==j*k: print("No"); continue
    m = a+(l*(c-a)-k*(d-b))/(i*l-j*k)*i
    n = b+(l*(c-a)-k*(d-b))/(i*l-j*k)*j
    if m!=a: print("Yes" if 0<(e-a)/(m-a)<1 and abs((e-a)/(m-a)-(g-c)/(m-c))<1e-9 else "No")
    else: print("Yes" if 0<(f-b)/(n-b)<1 and abs((f-b)/(n-b)-(h-d)/(n-d))<1e-9 else "No")
0