結果

問題 No.360 増加門松列
ユーザー 👑 KazunKazun
提出日時 2021-02-10 23:25:55
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 116 ms / 2,000 ms
コード長 358 bytes
コンパイル時間 797 ms
コンパイル使用メモリ 87,092 KB
実行使用メモリ 77,776 KB
最終ジャッジ日時 2023-09-22 19:54:36
合計ジャッジ時間 4,140 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 99 ms
76,724 KB
testcase_01 AC 101 ms
76,804 KB
testcase_02 AC 112 ms
77,776 KB
testcase_03 AC 96 ms
76,856 KB
testcase_04 AC 99 ms
76,688 KB
testcase_05 AC 99 ms
76,800 KB
testcase_06 AC 98 ms
76,876 KB
testcase_07 AC 98 ms
76,792 KB
testcase_08 AC 99 ms
76,756 KB
testcase_09 AC 99 ms
76,788 KB
testcase_10 AC 110 ms
77,764 KB
testcase_11 AC 93 ms
76,820 KB
testcase_12 AC 100 ms
76,592 KB
testcase_13 AC 107 ms
77,292 KB
testcase_14 AC 109 ms
77,080 KB
testcase_15 AC 77 ms
76,440 KB
testcase_16 AC 93 ms
76,728 KB
testcase_17 AC 116 ms
77,388 KB
testcase_18 AC 99 ms
77,300 KB
testcase_19 AC 98 ms
76,692 KB
testcase_20 AC 97 ms
76,556 KB
testcase_21 AC 96 ms
76,828 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def is_kaimatsu(a,b,c):
    if a==b or b==c or c==a:
        return False
    return (a>b<c) or (a<b>c)

from itertools import permutations
D=list(map(int,input().split()))
N=7

F=0
for t in permutations(D):
    G=1
    for i in range(5):
        if not (is_kaimatsu(t[i],t[i+1],t[i+2]) and t[i]<t[i+2]):
            G=0
    F|=G

print("YES" if F else "NO")
0