結果

問題 No.360 増加門松列
ユーザー rlangevinrlangevin
提出日時 2023-02-05 11:15:53
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 98 ms / 2,000 ms
コード長 418 bytes
コンパイル時間 397 ms
コンパイル使用メモリ 86,376 KB
実行使用メモリ 76,624 KB
最終ジャッジ日時 2023-09-17 04:31:38
合計ジャッジ時間 3,741 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 90 ms
76,312 KB
testcase_01 AC 96 ms
76,456 KB
testcase_02 AC 98 ms
76,292 KB
testcase_03 AC 97 ms
76,344 KB
testcase_04 AC 86 ms
76,340 KB
testcase_05 AC 86 ms
76,480 KB
testcase_06 AC 91 ms
76,276 KB
testcase_07 AC 88 ms
76,440 KB
testcase_08 AC 90 ms
76,420 KB
testcase_09 AC 88 ms
76,408 KB
testcase_10 AC 96 ms
76,368 KB
testcase_11 AC 96 ms
76,048 KB
testcase_12 AC 93 ms
76,248 KB
testcase_13 AC 93 ms
76,420 KB
testcase_14 AC 94 ms
76,460 KB
testcase_15 AC 75 ms
75,936 KB
testcase_16 AC 98 ms
76,624 KB
testcase_17 AC 89 ms
76,448 KB
testcase_18 AC 90 ms
76,332 KB
testcase_19 AC 95 ms
76,192 KB
testcase_20 AC 89 ms
76,176 KB
testcase_21 AC 91 ms
76,248 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import *

def kadomatsu(a, b, c):
    if a <= c:
        return False
    for i in [-1, 1]:
        if a * i < b * i and b * i > c * i and a != c:
            return True
    return False

D = list(map(int, input().split()))
ans = "NO"
for tup in permutations(D):
    for i in range(5):
        if not kadomatsu(tup[i], tup[i + 1], tup[i + 2]):
            break
    else:
        ans = "YES"
print(ans)
0