結果

問題 No.360 増加門松列
ユーザー 👑 rin204
提出日時 2022-07-12 13:32:51
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 53 ms / 2,000 ms
コード長 372 bytes
コンパイル時間 329 ms
コンパイル使用メモリ 82,688 KB
実行使用メモリ 64,256 KB
最終ジャッジ日時 2024-06-23 10:05:01
合計ジャッジ時間 2,109 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools

D = list(map(int, input().split()))
for lst in itertools.permutations(D):
    ok = True
    for i in range(1, 6):
        a = lst[i - 1]
        b = lst[i]
        c = lst[i + 1]
        if a < c < b or b < a < c:
            pass
        else:
            ok = False
            break
    if ok:
        print("YES")
        exit()
else:
    print("NO")
0