結果

問題 No.360 増加門松列
ユーザー Navier_BoltzmannNavier_Boltzmann
提出日時 2022-02-26 19:53:31
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 427 bytes
コンパイル時間 485 ms
コンパイル使用メモリ 10,876 KB
実行使用メモリ 8,292 KB
最終ジャッジ日時 2023-09-17 22:50:04
合計ジャッジ時間 2,146 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 18 ms
8,176 KB
testcase_03 AC 16 ms
8,196 KB
testcase_04 WA -
testcase_05 AC 26 ms
8,212 KB
testcase_06 WA -
testcase_07 AC 27 ms
8,052 KB
testcase_08 AC 26 ms
8,192 KB
testcase_09 AC 26 ms
8,188 KB
testcase_10 AC 19 ms
8,112 KB
testcase_11 AC 16 ms
8,084 KB
testcase_12 WA -
testcase_13 AC 18 ms
8,164 KB
testcase_14 AC 18 ms
8,132 KB
testcase_15 AC 23 ms
8,080 KB
testcase_16 AC 16 ms
8,056 KB
testcase_17 AC 16 ms
8,164 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 26 ms
8,164 KB
testcase_21 AC 26 ms
8,192 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 (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