結果

問題 No.411 昇順昇順ソート
ユーザー vwxyzvwxyz
提出日時 2022-08-05 20:07:37
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 557 ms / 2,000 ms
コード長 310 bytes
コンパイル時間 363 ms
コンパイル使用メモリ 86,956 KB
実行使用メモリ 77,044 KB
最終ジャッジ日時 2023-10-13 20:07:41
合計ジャッジ時間 7,004 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,024 KB
testcase_01 AC 74 ms
71,380 KB
testcase_02 AC 78 ms
71,416 KB
testcase_03 AC 73 ms
71,180 KB
testcase_04 AC 73 ms
71,200 KB
testcase_05 AC 73 ms
71,248 KB
testcase_06 AC 75 ms
71,028 KB
testcase_07 AC 73 ms
71,176 KB
testcase_08 AC 74 ms
71,300 KB
testcase_09 AC 73 ms
71,080 KB
testcase_10 AC 73 ms
71,224 KB
testcase_11 AC 72 ms
71,408 KB
testcase_12 AC 73 ms
71,212 KB
testcase_13 AC 72 ms
71,196 KB
testcase_14 AC 72 ms
71,104 KB
testcase_15 AC 73 ms
71,132 KB
testcase_16 AC 71 ms
71,152 KB
testcase_17 AC 73 ms
71,180 KB
testcase_18 AC 73 ms
70,964 KB
testcase_19 AC 73 ms
71,376 KB
testcase_20 AC 72 ms
71,204 KB
testcase_21 AC 73 ms
71,196 KB
testcase_22 AC 70 ms
71,136 KB
testcase_23 AC 71 ms
71,328 KB
testcase_24 AC 73 ms
70,968 KB
testcase_25 AC 73 ms
71,268 KB
testcase_26 AC 74 ms
71,284 KB
testcase_27 AC 88 ms
76,388 KB
testcase_28 AC 550 ms
76,972 KB
testcase_29 AC 249 ms
76,888 KB
testcase_30 AC 557 ms
76,996 KB
testcase_31 AC 548 ms
76,912 KB
testcase_32 AC 544 ms
76,804 KB
testcase_33 AC 549 ms
77,044 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
readline=sys.stdin.readline

N,K=map(int,readline().split())
K-=1
ans=0
for bit in range(1,(1<<N)-1):
    lstl,lstr=[],[]
    for i in range(N):
        if bit&1<<i:
            lstl.append(i)
        else:
            lstr.append(i)
    if lstl[0]==K and lstl[-1]>lstr[0]:
        ans+=1
print(ans)
0