結果

問題 No.360 増加門松列
ユーザー roarisroaris
提出日時 2019-08-28 19:38:32
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 84 ms / 2,000 ms
コード長 379 bytes
コンパイル時間 231 ms
コンパイル使用メモリ 82,560 KB
実行使用メモリ 76,160 KB
最終ジャッジ日時 2024-04-28 20:49:08
合計ジャッジ時間 2,617 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
73,216 KB
testcase_01 AC 77 ms
74,624 KB
testcase_02 AC 52 ms
60,032 KB
testcase_03 AC 42 ms
52,096 KB
testcase_04 AC 79 ms
74,368 KB
testcase_05 AC 71 ms
71,296 KB
testcase_06 AC 78 ms
73,600 KB
testcase_07 AC 75 ms
72,576 KB
testcase_08 AC 74 ms
72,320 KB
testcase_09 AC 70 ms
71,424 KB
testcase_10 AC 61 ms
65,792 KB
testcase_11 AC 46 ms
57,600 KB
testcase_12 AC 80 ms
76,032 KB
testcase_13 AC 54 ms
61,184 KB
testcase_14 AC 55 ms
60,800 KB
testcase_15 AC 59 ms
65,536 KB
testcase_16 AC 42 ms
51,840 KB
testcase_17 AC 53 ms
60,288 KB
testcase_18 AC 76 ms
73,472 KB
testcase_19 AC 84 ms
76,160 KB
testcase_20 AC 69 ms
70,784 KB
testcase_21 AC 74 ms
72,960 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