結果

問題 No.360 増加門松列
ユーザー AEnAEn
提出日時 2022-11-26 17:33:26
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 78 ms / 2,000 ms
コード長 389 bytes
コンパイル時間 437 ms
コンパイル使用メモリ 82,540 KB
実行使用メモリ 76,460 KB
最終ジャッジ日時 2024-04-14 04:25:41
合計ジャッジ時間 3,176 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
76,096 KB
testcase_01 AC 78 ms
76,072 KB
testcase_02 AC 60 ms
69,676 KB
testcase_03 AC 43 ms
59,596 KB
testcase_04 AC 78 ms
76,292 KB
testcase_05 AC 75 ms
76,252 KB
testcase_06 AC 77 ms
76,024 KB
testcase_07 AC 75 ms
76,376 KB
testcase_08 AC 77 ms
76,240 KB
testcase_09 AC 76 ms
76,460 KB
testcase_10 AC 74 ms
76,128 KB
testcase_11 AC 48 ms
60,504 KB
testcase_12 AC 78 ms
76,028 KB
testcase_13 AC 63 ms
72,700 KB
testcase_14 AC 64 ms
71,580 KB
testcase_15 AC 50 ms
69,424 KB
testcase_16 AC 46 ms
59,776 KB
testcase_17 AC 62 ms
69,932 KB
testcase_18 AC 77 ms
76,204 KB
testcase_19 AC 77 ms
76,132 KB
testcase_20 AC 76 ms
76,080 KB
testcase_21 AC 78 ms
76,116 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import permutations

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

for v in permutations(range(7),7):
    cnt = 0
    for i in range(5):
        a = [D[v[i]],D[v[i+1]],D[v[i+2]]]
        if len(set(a))!=3:continue
        if max(a)!=D[v[i+1]] and min(a)!=D[v[i+1]]:continue
        if D[v[i]]>=D[v[i+2]]:continue
        cnt += 1
    if cnt==5:
        exit(print('YES'))
print('NO')
0