結果

問題 No.411 昇順昇順ソート
コンテスト
ユーザー _KingdomOfMoray
提出日時 2020-01-11 23:21:59
言語 Python3
(3.14.3 + numpy 2.4.4 + scipy 1.17.1)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
TLE  
実行時間 -
コード長 593 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 492 ms
コンパイル使用メモリ 20,828 KB
実行使用メモリ 73,868 KB
最終ジャッジ日時 2026-05-20 19:09:13
合計ジャッジ時間 7,404 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 24 TLE * 1 -- * 5
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import itertools

n, k = map(int,input().split())

num_list = list(range(1, n + 1))
split_list = []
res = 0

for i in range(1, n // 2 + 1):
    split_list.append([i, n - i])
    if i != n - i:
        split_list.append([n - i, i])

for i in range(len(split_list)):
    cur_list = list(itertools.combinations(num_list, split_list[i][0]))

    for j in range(len(cur_list)):
        one_list = cur_list[j]
        another_list = [e for e in num_list if e not in cur_list[j]]
        
        if one_list[0] == k and max(one_list) > min(another_list):
            res += 1
            
print(res)
0