結果

問題 No.360 増加門松列
ユーザー ayaoniayaoni
提出日時 2020-12-18 05:03:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 69 ms / 2,000 ms
コード長 759 bytes
コンパイル時間 171 ms
コンパイル使用メモリ 81,832 KB
実行使用メモリ 72,952 KB
最終ジャッジ日時 2023-10-21 07:51:54
合計ジャッジ時間 2,306 ms
ジャッジサーバーID
(参考情報)
judge10 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 61 ms
70,560 KB
testcase_01 AC 63 ms
70,564 KB
testcase_02 AC 46 ms
61,436 KB
testcase_03 AC 43 ms
58,984 KB
testcase_04 AC 65 ms
72,628 KB
testcase_05 AC 60 ms
70,560 KB
testcase_06 AC 69 ms
72,952 KB
testcase_07 AC 58 ms
70,532 KB
testcase_08 AC 61 ms
70,544 KB
testcase_09 AC 61 ms
70,576 KB
testcase_10 AC 51 ms
64,368 KB
testcase_11 AC 46 ms
59,384 KB
testcase_12 AC 64 ms
70,560 KB
testcase_13 AC 45 ms
61,436 KB
testcase_14 AC 47 ms
61,436 KB
testcase_15 AC 52 ms
66,412 KB
testcase_16 AC 42 ms
58,988 KB
testcase_17 AC 47 ms
61,452 KB
testcase_18 AC 64 ms
72,632 KB
testcase_19 AC 65 ms
72,628 KB
testcase_20 AC 56 ms
68,480 KB
testcase_21 AC 60 ms
70,560 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from itertools import permutations
sys.setrecursionlimit(10**7)
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LI2(): return list(map(int,sys.stdin.readline().rstrip()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
def LS2(): return list(sys.stdin.readline().rstrip())


D = LI()
for p in list(permutations([i for i in range(7)],7)):
    X = [D[p[i]] for i in range(7)]
    for i in range(5):
        x,y,z = X[i:i+3]
        if not (x < z < y or y < x < z):
            break
    else:
        print('YES')
        break
else:
    print('NO')
0