結果

問題 No.411 昇順昇順ソート
ユーザー kohei2019kohei2019
提出日時 2022-01-23 13:10:24
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 71 ms / 2,000 ms
コード長 186 bytes
コンパイル時間 1,709 ms
コンパイル使用メモリ 87,004 KB
実行使用メモリ 71,444 KB
最終ジャッジ日時 2023-08-19 17:46:14
合計ジャッジ時間 4,926 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,136 KB
testcase_01 AC 69 ms
71,180 KB
testcase_02 AC 67 ms
70,960 KB
testcase_03 AC 69 ms
70,984 KB
testcase_04 AC 68 ms
71,264 KB
testcase_05 AC 69 ms
70,984 KB
testcase_06 AC 67 ms
71,148 KB
testcase_07 AC 68 ms
71,256 KB
testcase_08 AC 69 ms
71,172 KB
testcase_09 AC 68 ms
71,140 KB
testcase_10 AC 69 ms
71,080 KB
testcase_11 AC 68 ms
71,276 KB
testcase_12 AC 69 ms
71,352 KB
testcase_13 AC 70 ms
71,224 KB
testcase_14 AC 67 ms
71,244 KB
testcase_15 AC 68 ms
71,244 KB
testcase_16 AC 70 ms
71,180 KB
testcase_17 AC 70 ms
71,136 KB
testcase_18 AC 70 ms
71,372 KB
testcase_19 AC 70 ms
71,360 KB
testcase_20 AC 70 ms
71,384 KB
testcase_21 AC 70 ms
71,244 KB
testcase_22 AC 70 ms
71,116 KB
testcase_23 AC 69 ms
71,348 KB
testcase_24 AC 69 ms
71,324 KB
testcase_25 AC 70 ms
71,356 KB
testcase_26 AC 71 ms
71,176 KB
testcase_27 AC 71 ms
70,956 KB
testcase_28 AC 70 ms
71,112 KB
testcase_29 AC 70 ms
71,184 KB
testcase_30 AC 70 ms
71,240 KB
testcase_31 AC 70 ms
71,444 KB
testcase_32 AC 70 ms
71,240 KB
testcase_33 AC 71 ms
71,364 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K = map(int,input().split())
if K == 1:
    ans = 0
    ii = 0
    for i in range(N-2,0,-1):
        ans += i*2**ii
        ii += 1
    print(ans)
    exit()

ans = 2**(N-K)
print(ans)
0