結果

問題 No.2628 Shrinkage
ユーザー ニックネームニックネーム
提出日時 2024-02-16 23:45:57
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 453 bytes
コンパイル時間 149 ms
コンパイル使用メモリ 11,904 KB
実行使用メモリ 10,112 KB
最終ジャッジ日時 2024-02-16 23:45:59
合計ジャッジ時間 2,151 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
10,112 KB
testcase_01 WA -
testcase_02 AC 31 ms
10,112 KB
testcase_03 WA -
testcase_04 RE -
testcase_05 WA -
testcase_06 RE -
testcase_07 RE -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 31 ms
10,112 KB
testcase_13 RE -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 31 ms
10,112 KB
testcase_22 WA -
testcase_23 AC 30 ms
10,112 KB
testcase_24 WA -
testcase_25 RE -
testcase_26 AC 30 ms
10,112 KB
testcase_27 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

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 (a,b,c,d)==(e,f,g,h): print("Yes"); continue
    if (a,b)==(e,f) or (c,d)==(g,h) or 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
    o = (e-a)/(m-a) if m!=a else (f-b)/(n-b)
    p = (g-c)/(m-c) if m!=c else (h-d)/(n-d)
    print("Yes" if 0<o<1 and abs(o-p)<1e-9 else "No")
0