結果

問題 No.360 増加門松列
ユーザー nanaenanae
提出日時 2017-02-10 11:29:59
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 629 bytes
コンパイル時間 139 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-12-26 14:25:11
合計ジャッジ時間 1,791 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 13 WA * 9
権限があれば一括ダウンロードができます

ソースコード

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