結果

問題 No.360 増加門松列
ユーザー rlangevin
提出日時 2023-02-05 11:15:53
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 71 ms / 2,000 ms
コード長 418 bytes
コンパイル時間 149 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 71,424 KB
最終ジャッジ日時 2024-07-04 02:02:33
合計ジャッジ時間 2,454 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

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