結果

問題 No.360 増加門松列
ユーザー yaoshimaxyaoshimax
提出日時 2016-04-17 23:54:38
言語 Python2
(2.7.18)
結果
AC  
実行時間 19 ms / 2,000 ms
コード長 550 bytes
コンパイル時間 58 ms
コンパイル使用メモリ 6,604 KB
実行使用メモリ 6,104 KB
最終ジャッジ日時 2023-08-25 18:36:29
合計ジャッジ時間 1,308 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
5,976 KB
testcase_01 AC 18 ms
6,104 KB
testcase_02 AC 12 ms
6,040 KB
testcase_03 AC 11 ms
6,016 KB
testcase_04 AC 18 ms
6,056 KB
testcase_05 AC 16 ms
6,088 KB
testcase_06 AC 17 ms
5,972 KB
testcase_07 AC 16 ms
6,016 KB
testcase_08 AC 16 ms
5,912 KB
testcase_09 AC 16 ms
6,104 KB
testcase_10 AC 12 ms
6,096 KB
testcase_11 AC 11 ms
5,912 KB
testcase_12 AC 17 ms
6,084 KB
testcase_13 AC 12 ms
6,076 KB
testcase_14 AC 12 ms
6,084 KB
testcase_15 AC 15 ms
5,984 KB
testcase_16 AC 11 ms
6,080 KB
testcase_17 AC 12 ms
5,960 KB
testcase_18 AC 18 ms
5,984 KB
testcase_19 AC 17 ms
5,952 KB
testcase_20 AC 16 ms
5,952 KB
testcase_21 AC 17 ms
6,036 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools
def isKadomatsu(A):
    if A[0]==A[1] or A[1]==A[2] or A[0]==A[2]:
        return False
    elif A[0]<A[1] and A[1]>A[2]:
        return True
    elif A[0]>A[1] and A[1]<A[2]:
        return True
    return False
X=map(int,raw_input().split())
for line in itertools.permutations(X):
    ok=True
    for i in range(5):
        B=[line[i],line[i+1],line[i+2]]
        if( isKadomatsu(B) and B[0]<B[2] ):
            continue
        else:
            ok=False
            break
    if ok:
        print "YES"
        exit()
print "NO"
0