結果

問題 No.360 増加門松列
ユーザー HachimoriHachimori
提出日時 2016-04-17 22:54:36
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 613 bytes
コンパイル時間 141 ms
コンパイル使用メモリ 6,912 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-15 02:23:01
合計ジャッジ時間 1,110 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 11 ms
6,940 KB
testcase_03 AC 10 ms
6,940 KB
testcase_04 WA -
testcase_05 AC 16 ms
6,940 KB
testcase_06 WA -
testcase_07 AC 17 ms
6,944 KB
testcase_08 WA -
testcase_09 AC 17 ms
6,944 KB
testcase_10 AC 11 ms
6,940 KB
testcase_11 AC 10 ms
6,940 KB
testcase_12 WA -
testcase_13 AC 11 ms
6,940 KB
testcase_14 AC 10 ms
6,940 KB
testcase_15 AC 15 ms
6,940 KB
testcase_16 AC 11 ms
6,940 KB
testcase_17 AC 11 ms
6,940 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 17 ms
6,940 KB
testcase_21 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python
#coding:utf8

import itertools


def read():
    return map(int, raw_input().split())


def isKadomatsu(A1, A2, A3):
    return len(set([A1, A2, A3])) == 3 and (A2 > max(A1, A3) or A2 < min(A1, A3))


def work(vList):

    for candi in itertools.permutations(vList, len(vList)):
        isOK = True
        for i in range(len(vList) - 2):
            if not isKadomatsu(candi[i], candi[i + 1], candi[i + 2]):
                isOK = False
                break

        if isOK:
            print "YES"
            return
    
    print "NO"

    
if __name__ == "__main__":
    work(read())
0