結果

問題 No.411 昇順昇順ソート
ユーザー _KingdomOfMoray_KingdomOfMoray
提出日時 2020-01-12 08:56:03
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 647 bytes
コンパイル時間 215 ms
コンパイル使用メモリ 10,840 KB
実行使用メモリ 58,772 KB
最終ジャッジ日時 2023-08-18 16:11:18
合計ジャッジ時間 14,082 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 14 ms
8,188 KB
testcase_01 AC 14 ms
8,120 KB
testcase_02 AC 13 ms
8,252 KB
testcase_03 AC 13 ms
8,224 KB
testcase_04 AC 14 ms
8,256 KB
testcase_05 AC 14 ms
8,216 KB
testcase_06 AC 14 ms
8,296 KB
testcase_07 AC 14 ms
8,140 KB
testcase_08 AC 13 ms
8,224 KB
testcase_09 AC 13 ms
8,052 KB
testcase_10 AC 13 ms
8,156 KB
testcase_11 AC 14 ms
8,260 KB
testcase_12 AC 14 ms
8,260 KB
testcase_13 AC 13 ms
8,132 KB
testcase_14 AC 13 ms
8,288 KB
testcase_15 AC 14 ms
8,132 KB
testcase_16 AC 17 ms
8,272 KB
testcase_17 AC 13 ms
8,248 KB
testcase_18 AC 13 ms
8,116 KB
testcase_19 AC 14 ms
8,236 KB
testcase_20 AC 13 ms
8,244 KB
testcase_21 AC 14 ms
8,272 KB
testcase_22 AC 14 ms
8,048 KB
testcase_23 AC 15 ms
8,228 KB
testcase_24 AC 14 ms
8,148 KB
testcase_25 AC 14 ms
8,112 KB
testcase_26 AC 14 ms
8,060 KB
testcase_27 AC 40 ms
9,780 KB
testcase_28 TLE -
testcase_29 AC 1,095 ms
33,776 KB
testcase_30 TLE -
testcase_31 TLE -
testcase_32 TLE -
testcase_33 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

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)
    if i != n - i:
        split_list.append(n - i)

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

    for j in range(len(cur_list)):
        if k not in cur_list[j]:
            continue
            
        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