結果

問題 No.411 昇順昇順ソート
ユーザー nebukuro09nebukuro09
提出日時 2016-10-26 15:14:55
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 585 ms / 2,000 ms
コード長 357 bytes
コンパイル時間 276 ms
コンパイル使用メモリ 77,804 KB
実行使用メモリ 79,372 KB
最終ジャッジ日時 2023-08-15 19:25:00
合計ジャッジ時間 7,032 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
76,492 KB
testcase_01 AC 75 ms
76,468 KB
testcase_02 AC 74 ms
76,248 KB
testcase_03 AC 75 ms
76,120 KB
testcase_04 AC 76 ms
76,208 KB
testcase_05 AC 74 ms
76,408 KB
testcase_06 AC 75 ms
76,256 KB
testcase_07 AC 74 ms
76,264 KB
testcase_08 AC 73 ms
76,476 KB
testcase_09 AC 75 ms
76,464 KB
testcase_10 AC 75 ms
76,260 KB
testcase_11 AC 74 ms
76,224 KB
testcase_12 AC 75 ms
76,472 KB
testcase_13 AC 75 ms
76,472 KB
testcase_14 AC 75 ms
76,120 KB
testcase_15 AC 76 ms
76,232 KB
testcase_16 AC 76 ms
76,192 KB
testcase_17 AC 76 ms
76,244 KB
testcase_18 AC 75 ms
76,496 KB
testcase_19 AC 75 ms
76,492 KB
testcase_20 AC 75 ms
76,124 KB
testcase_21 AC 75 ms
76,276 KB
testcase_22 AC 75 ms
76,228 KB
testcase_23 AC 74 ms
76,500 KB
testcase_24 AC 75 ms
76,400 KB
testcase_25 AC 75 ms
76,492 KB
testcase_26 AC 76 ms
76,116 KB
testcase_27 AC 95 ms
79,372 KB
testcase_28 AC 585 ms
78,964 KB
testcase_29 AC 250 ms
78,980 KB
testcase_30 AC 578 ms
79,352 KB
testcase_31 AC 584 ms
79,260 KB
testcase_32 AC 577 ms
79,120 KB
testcase_33 AC 571 ms
79,112 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, K = map(int, raw_input().split())

ans = 0
for b in xrange(1<<N):
    L1, L2 = [], []
    for i in xrange(N):
        if b & (1<<i):
            L1.append(i+1)
        else:
            L2.append(i+1)
    if len(L1) == 0 or len(L2) == 0:
        continue
    if L1[0] != K:
        continue
    if L1[-1] < L2[0]:
        continue
    ans += 1
print ans
0