結果

問題 No.360 増加門松列
ユーザー Navier_BoltzmannNavier_Boltzmann
提出日時 2022-02-26 19:54:23
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 29 ms / 2,000 ms
コード長 480 bytes
コンパイル時間 84 ms
コンパイル使用メモリ 10,720 KB
実行使用メモリ 8,204 KB
最終ジャッジ日時 2023-09-17 22:51:52
合計ジャッジ時間 1,699 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
8,116 KB
testcase_01 AC 29 ms
8,176 KB
testcase_02 AC 19 ms
8,124 KB
testcase_03 AC 18 ms
8,172 KB
testcase_04 AC 27 ms
8,200 KB
testcase_05 AC 25 ms
8,176 KB
testcase_06 AC 26 ms
8,108 KB
testcase_07 AC 25 ms
8,108 KB
testcase_08 AC 25 ms
8,180 KB
testcase_09 AC 25 ms
8,168 KB
testcase_10 AC 19 ms
8,064 KB
testcase_11 AC 17 ms
8,076 KB
testcase_12 AC 27 ms
8,112 KB
testcase_13 AC 19 ms
8,196 KB
testcase_14 AC 18 ms
8,076 KB
testcase_15 AC 23 ms
8,068 KB
testcase_16 AC 17 ms
8,144 KB
testcase_17 AC 18 ms
8,120 KB
testcase_18 AC 26 ms
8,120 KB
testcase_19 AC 27 ms
8,200 KB
testcase_20 AC 24 ms
8,068 KB
testcase_21 AC 26 ms
8,204 KB
権限があれば一括ダウンロードができます

ソースコード

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 len(set(T)) !=3:
            return False
        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