結果

問題 No.360 増加門松列
ユーザー Mcpu3
提出日時 2020-04-04 17:35:00
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 34 ms / 2,000 ms
コード長 384 bytes
コンパイル時間 79 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-07-03 07:32:40
合計ジャッジ時間 1,760 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools

D = [int(i) for i in input().split()]
D.sort()
a = False
for i in itertools.permutations(D):
	b = True
	for j in range(5):
		if i[j] < i[j + 1] and i[j] < i[j + 2] and i[j + 2] < i[j + 1] or i[j] < i[j + 2] and i[j + 1] < i[j] and i[j + 1] < i[j + 2]:
			continue
		b = False
		break
	if b:
		a = True
		break
if a:
	print('YES')
else:
	print('NO')
0