結果

問題 No.635 自然門松列
ユーザー Navier_BoltzmannNavier_Boltzmann
提出日時 2023-11-09 08:55:11
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,173 bytes
コンパイル時間 303 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 72,444 KB
最終ジャッジ日時 2023-11-09 08:55:16
合計ジャッジ時間 3,324 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 48 ms
55,608 KB
testcase_01 AC 50 ms
55,608 KB
testcase_02 AC 48 ms
55,608 KB
testcase_03 AC 54 ms
63,652 KB
testcase_04 AC 50 ms
57,704 KB
testcase_05 AC 76 ms
70,372 KB
testcase_06 AC 86 ms
70,372 KB
testcase_07 AC 90 ms
70,372 KB
testcase_08 WA -
testcase_09 AC 49 ms
57,704 KB
testcase_10 WA -
testcase_11 AC 59 ms
65,988 KB
testcase_12 AC 75 ms
72,444 KB
testcase_13 AC 73 ms
72,440 KB
testcase_14 AC 75 ms
70,368 KB
testcase_15 WA -
testcase_16 AC 50 ms
55,608 KB
testcase_17 WA -
testcase_18 AC 68 ms
68,176 KB
testcase_19 AC 63 ms
68,040 KB
testcase_20 AC 67 ms
68,036 KB
testcase_21 AC 100 ms
68,436 KB
testcase_22 AC 72 ms
68,024 KB
testcase_23 AC 69 ms
68,296 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import *
from itertools import *
from functools import *
from heapq import *
import sys,math
input = sys.stdin.readline

N = int(input())
eps = 0.0001

def answer():
    
    x1,x2,x3,y1,y2,y3 = map(int,input().split())
    
    X = [x1,x2,x3]
    Y = [y1,y2,y3]
    
    def eq(i,j):
        
        if Y[i]==Y[j]:
            
            if X[i]!=X[j]:
                return -1
            else:
                return 1
        return (X[i]-X[j])/(Y[j]-Y[i])
    
    def check(t):
        
        Z = [X[i]+Y[i]*t for i in range(3)]
        if len(set(Z))!=3:
            return False
        
        if (min(Z)==Z[1])|(max(Z)==Z[1]):
            return True

        return False
        
    if check(0):
        print('YES')
        return
    
    for i in range(3):
        for j in range(3):
            
            t = eq(i,j)

            if t<0:
                continue
            if t==0:
                if check(eps):
                    print('YES')
                    return
            if (check(t+eps)|check(t-eps)):
                print('YES')
                return
    print('NO')
    return
for _ in range(N):
    answer()
0