結果

問題 No.635 自然門松列
ユーザー titia
提出日時 2024-08-18 02:31:22
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 1,574 bytes
コンパイル時間 207 ms
コンパイル使用メモリ 12,928 KB
実行使用メモリ 11,136 KB
最終ジャッジ日時 2024-08-18 02:31:25
合計ジャッジ時間 2,164 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 22 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

N=int(input())

for i in range(N):
    x1,x2,x3,y1,y2,y3=map(int,input().split())

    if y1==y2 and x1==x2:
        print("NO")
        continue

    if y1==y3 and x1==x3:
        print("NO")
        continue

    if y2==y3 and x2==x3:
        print("NO")
        continue

    A=[]# x1<x2
    B=[]# x2<x1
    C=[]# x1<x3
    D=[]# x3<x1

    # x1+ay1<x2+ay2

    if y1==y2:
        if x1<x2:
            A=[0,10**18]
        elif x2<x1:
            A=[0,10**18]

    elif y1<y2:
        a=(x2-x1)/(y1-y2)

        if a<=0:
            A=[0,10**18]
        else:
            A=[a,10**18]
            B=[0,a]
    else:
        a=(x2-x1)/(y1-y2)

        if a<=0:
            B=[0,10**18]
        else:
            B=[a,10**18]
            A=[0,a]

    if y2==y3:
        if x3<x2:
            C=[0,10**18]
        elif x2<x3:
            D=[0,10**18]

    elif y3<y2:
        a=(x2-x3)/(y3-y2)

        if a<=0:
            C=[0,10**18]
        else:
            C=[a,10**18]
            D=[0,a]
    else:
        a=(x2-x3)/(y3-y2)

        if a<=0:
            D=[0,10**18]
        else:
            D=[a,10**18]
            C=[0,a]

    if A!=[] and C!=[]:
        a,b=A
        c,d=C

        if a>c:
            a,b=C
            c,d=A

        if b>c:
            print("YES")
            continue

    if B!=[] and D!=[]:
        a,b=B
        c,d=D

        if a>c:
            a,b=D
            c,d=B

        if b>c:
            print("YES")
            continue

    print("NO")
        

    

    
            

    

    
0