結果
| 問題 | No.635 自然門松列 |
| コンテスト | |
| ユーザー |
convexineq
|
| 提出日時 | 2021-02-26 03:48:04 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 47 ms / 650 ms |
| コード長 | 691 bytes |
| 記録 | |
| コンパイル時間 | 162 ms |
| コンパイル使用メモリ | 82,976 KB |
| 実行使用メモリ | 61,720 KB |
| 最終ジャッジ日時 | 2025-11-29 09:18:55 |
| 合計ジャッジ時間 | 2,233 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 24 |
ソースコード
def solve(x,y,z,a,b,c):
def is_kadomatsu(a,b,c): return a!=c and (a < b > c or a > b < c)
def is_kadomatsu_t(t): return is_kadomatsu(x+a*t,y+b*t,z+c*t)
if is_kadomatsu_t(0): return 1
if is_kadomatsu_t(1e8): return 1
if a != b:
t = (y-x)/(a-b)
if t > 0:
if is_kadomatsu_t(t-1e-8): return 1
if is_kadomatsu_t(t+1e-8): return 1
if b != c:
t = (y-z)/(c-b)
if t > 0:
if is_kadomatsu_t(t-1e-8): return 1
if is_kadomatsu_t(t+1e-8): return 1
if is_kadomatsu_t(10**9): return 1
return 0
T = int(input())
for _ in range(T):
print("YES" if solve(*map(int,input().split())) else "NO")
convexineq