結果

問題 No.360 増加門松列
ユーザー 💕💖💞💕💖💞
提出日時 2018-07-26 23:12:23
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 406 bytes
コンパイル時間 89 ms
コンパイル使用メモリ 10,620 KB
実行使用メモリ 8,336 KB
最終ジャッジ日時 2023-09-13 18:50:38
合計ジャッジ時間 1,997 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 19 ms
8,236 KB
testcase_03 AC 17 ms
8,100 KB
testcase_04 WA -
testcase_05 AC 43 ms
8,112 KB
testcase_06 WA -
testcase_07 AC 42 ms
8,100 KB
testcase_08 AC 42 ms
8,100 KB
testcase_09 AC 43 ms
8,156 KB
testcase_10 AC 23 ms
8,140 KB
testcase_11 AC 17 ms
8,124 KB
testcase_12 WA -
testcase_13 AC 20 ms
8,240 KB
testcase_14 AC 20 ms
8,224 KB
testcase_15 AC 38 ms
8,192 KB
testcase_16 AC 16 ms
8,224 KB
testcase_17 AC 15 ms
8,224 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 42 ms
8,152 KB
testcase_21 AC 43 ms
8,232 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools
import sys
xs = list(map(int, input().split()))
for ps in itertools.permutations(xs, len(xs)):
  kc = []
  bs = []
  for i in range(0, len(ps)-2):
    slice = ps[i:i+3]
    if max(slice)  == slice[1] or min(slice) == slice[1]:
      kc.append(True)
    else:
      kc.append(False)
    bs.append(slice[0] < slice[2])

  if all(kc) and all(bs):
    print('YES')
    sys.exit() 

print('NO')
0