結果

問題 No.635 自然門松列
ユーザー convexineqconvexineq
提出日時 2021-02-26 03:48:04
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 39 ms / 650 ms
コード長 691 bytes
コンパイル時間 238 ms
コンパイル使用メモリ 82,160 KB
実行使用メモリ 61,260 KB
最終ジャッジ日時 2024-04-09 19:19:40
合計ジャッジ時間 1,840 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
52,524 KB
testcase_01 AC 28 ms
53,144 KB
testcase_02 AC 30 ms
52,664 KB
testcase_03 AC 31 ms
52,264 KB
testcase_04 AC 32 ms
52,072 KB
testcase_05 AC 39 ms
61,260 KB
testcase_06 AC 37 ms
60,768 KB
testcase_07 AC 37 ms
60,984 KB
testcase_08 AC 29 ms
52,800 KB
testcase_09 AC 30 ms
52,864 KB
testcase_10 AC 35 ms
59,740 KB
testcase_11 AC 35 ms
60,188 KB
testcase_12 AC 37 ms
61,068 KB
testcase_13 AC 37 ms
60,188 KB
testcase_14 AC 36 ms
60,144 KB
testcase_15 AC 29 ms
53,672 KB
testcase_16 AC 31 ms
53,104 KB
testcase_17 AC 37 ms
60,376 KB
testcase_18 AC 37 ms
60,780 KB
testcase_19 AC 37 ms
60,360 KB
testcase_20 AC 37 ms
60,704 KB
testcase_21 AC 36 ms
60,136 KB
testcase_22 AC 36 ms
61,068 KB
testcase_23 AC 37 ms
60,280 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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")
0