結果
| 問題 |
No.360 増加門松列
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-02-10 11:34:42 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 38 ms / 2,000 ms |
| コード長 | 801 bytes |
| コンパイル時間 | 163 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2024-12-24 04:37:06 |
| 合計ジャッジ時間 | 1,748 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 |
ソースコード
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
elif not(line[0] < line[2] < line[4] < line[6]
and line[1] < line[3] < line[5]):
break
else:
print('YES')
# debug(line, locals())
return
print('NO')
if __name__ == '__main__':
solve()