結果

問題 No.360 増加門松列
ユーザー nanaenanae
提出日時 2017-02-10 11:29:59
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 629 bytes
コンパイル時間 90 ms
コンパイル使用メモリ 10,972 KB
実行使用メモリ 8,324 KB
最終ジャッジ日時 2023-08-27 05:18:56
合計ジャッジ時間 1,827 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 16 ms
8,180 KB
testcase_03 AC 17 ms
8,144 KB
testcase_04 WA -
testcase_05 AC 19 ms
8,136 KB
testcase_06 WA -
testcase_07 AC 20 ms
8,240 KB
testcase_08 WA -
testcase_09 AC 19 ms
8,292 KB
testcase_10 AC 16 ms
8,272 KB
testcase_11 AC 16 ms
8,196 KB
testcase_12 WA -
testcase_13 AC 16 ms
8,304 KB
testcase_14 AC 16 ms
8,140 KB
testcase_15 AC 18 ms
8,192 KB
testcase_16 AC 16 ms
8,136 KB
testcase_17 AC 16 ms
8,180 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 19 ms
8,188 KB
testcase_21 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from itertools import permutations

def debug(x, table):
    for name, val in table.items():
        if x is val:
            print('DEBUG:{} -> {}'.format(name, val), file=sys.stderr)
            return None

def is_kadomatu(a):
    return a[0] != a[2] and (a[0] - a[1])*(a[2] - a[1]) > 0

def solve():
    Ds = [int(i) for i in input().split()]

    for line in permutations(Ds):
        for i in range(7 - 2):
            if not is_kadomatu((line[i], line[i + 1], line[i + 2])):
                break
        else:
            print('YES')
            return

    print('NO')

if __name__ == '__main__':
    solve()
0