結果

問題 No.360 増加門松列
ユーザー ntuda
提出日時 2025-02-26 22:31:51
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 73 ms / 2,000 ms
コード長 366 bytes
コンパイル時間 373 ms
コンパイル使用メモリ 82,900 KB
実行使用メモリ 76,648 KB
最終ジャッジ日時 2025-02-26 22:31:54
合計ジャッジ時間 2,789 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

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

for X in permutations(range(7),7):
    for i in range(5):
        Y = [D[X[i]],D[X[i+1]],D[X[i+2]]]
        if (max(Y) == Y[1] or min(Y) == Y[1]) and Y[0] < Y[2] and len(set(Y)) == 3:
            continue
        else:
            break
    else:
        print("YES")
        exit()
print("NO")
0