結果

問題 No.360 増加門松列
ユーザー 👑 rin204rin204
提出日時 2022-07-12 13:32:51
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 89 ms / 2,000 ms
コード長 372 bytes
コンパイル時間 748 ms
コンパイル使用メモリ 87,308 KB
実行使用メモリ 76,788 KB
最終ジャッジ日時 2023-09-05 14:24:53
合計ジャッジ時間 3,561 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 88 ms
76,352 KB
testcase_01 AC 89 ms
76,788 KB
testcase_02 AC 76 ms
71,696 KB
testcase_03 AC 74 ms
71,508 KB
testcase_04 AC 89 ms
76,608 KB
testcase_05 AC 84 ms
76,568 KB
testcase_06 AC 85 ms
76,560 KB
testcase_07 AC 84 ms
76,460 KB
testcase_08 AC 84 ms
76,528 KB
testcase_09 AC 84 ms
76,552 KB
testcase_10 AC 80 ms
76,360 KB
testcase_11 AC 72 ms
71,460 KB
testcase_12 AC 86 ms
76,668 KB
testcase_13 AC 74 ms
71,496 KB
testcase_14 AC 74 ms
71,472 KB
testcase_15 AC 77 ms
76,460 KB
testcase_16 AC 74 ms
71,572 KB
testcase_17 AC 76 ms
71,576 KB
testcase_18 AC 86 ms
76,644 KB
testcase_19 AC 89 ms
76,736 KB
testcase_20 AC 85 ms
76,748 KB
testcase_21 AC 88 ms
76,656 KB
権限があれば一括ダウンロードができます

ソースコード

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