結果
| 問題 |
No.635 自然門松列
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-11-09 08:56:02 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,177 bytes |
| コンパイル時間 | 173 ms |
| コンパイル使用メモリ | 82,400 KB |
| 実行使用メモリ | 71,552 KB |
| 最終ジャッジ日時 | 2024-09-26 00:03:04 |
| 合計ジャッジ時間 | 2,484 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 21 WA * 2 |
ソースコード
from collections import *
from itertools import *
from functools import *
from heapq import *
import sys,math
input = sys.stdin.readline
N = int(input())
eps = 0.00000001
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()