結果

問題 No.360 増加門松列
ユーザー Navier_Boltzmann
提出日時 2022-02-26 19:53:31
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 427 bytes
コンパイル時間 240 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-07-04 16:25:04
合計ジャッジ時間 1,885 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 15 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

D = list(map(int,input().split()))

from itertools import permutations


def is_ok(X):
    for i in range(1,6):
        T = X[i-1:i+2]
        if (T[1]==min(T) or T[1] == max(T)) and T[0]<T[2]:
            continue
        else:
            return False
    return True

for p in permutations([i for i in range(7)]):
    
    P = [D[p[i]] for i in range(7)]
    
    if is_ok(P):
        print("YES")
        exit()
print("NO")
0