結果

問題 No.360 増加門松列
ユーザー roarisroaris
提出日時 2019-08-28 19:38:32
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 99 ms / 2,000 ms
コード長 379 bytes
コンパイル時間 490 ms
コンパイル使用メモリ 86,940 KB
実行使用メモリ 77,384 KB
最終ジャッジ日時 2023-08-11 03:46:56
合計ジャッジ時間 3,686 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 92 ms
77,292 KB
testcase_01 AC 99 ms
77,208 KB
testcase_02 AC 77 ms
75,152 KB
testcase_03 AC 71 ms
71,048 KB
testcase_04 AC 95 ms
77,236 KB
testcase_05 AC 93 ms
76,524 KB
testcase_06 AC 96 ms
77,120 KB
testcase_07 AC 94 ms
77,160 KB
testcase_08 AC 90 ms
76,440 KB
testcase_09 AC 89 ms
76,560 KB
testcase_10 AC 84 ms
76,404 KB
testcase_11 AC 72 ms
75,308 KB
testcase_12 AC 96 ms
77,004 KB
testcase_13 AC 79 ms
75,264 KB
testcase_14 AC 80 ms
75,156 KB
testcase_15 AC 81 ms
76,360 KB
testcase_16 AC 74 ms
71,308 KB
testcase_17 AC 76 ms
75,268 KB
testcase_18 AC 93 ms
77,368 KB
testcase_19 AC 99 ms
77,384 KB
testcase_20 AC 89 ms
76,704 KB
testcase_21 AC 93 ms
77,184 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import permutations

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

for l in permutations(D):
    for i in range(5):
        sub_l = [l[i], l[i+1], l[i+2]]
        
        if l[i+1] in [min(sub_l), max(sub_l)] and l[i] < l[i+2] and 3 == len(set(sub_l)):
            continue
        else:
            break
    else:
        print('YES')
        break
else:
    print('NO')
0