結果
| 問題 |
No.635 自然門松列
|
| コンテスト | |
| ユーザー |
titia
|
| 提出日時 | 2024-08-18 02:33:17 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 35 ms / 650 ms |
| コード長 | 1,574 bytes |
| コンパイル時間 | 723 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 11,008 KB |
| 最終ジャッジ日時 | 2024-08-18 02:33:19 |
| 合計ジャッジ時間 | 2,496 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 23 |
ソースコード
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:
B=[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")
titia