結果

問題 No.1869 Doubling?
ユーザー prussian_coderprussian_coder
提出日時 2022-03-19 14:12:47
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 175 ms / 2,000 ms
コード長 204 bytes
コンパイル時間 142 ms
コンパイル使用メモリ 82,520 KB
実行使用メモリ 301,780 KB
最終ジャッジ日時 2024-04-15 03:27:12
合計ジャッジ時間 3,571 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
53,212 KB
testcase_01 AC 34 ms
52,884 KB
testcase_02 AC 36 ms
52,704 KB
testcase_03 AC 47 ms
88,212 KB
testcase_04 AC 63 ms
147,704 KB
testcase_05 AC 64 ms
150,188 KB
testcase_06 AC 34 ms
52,240 KB
testcase_07 AC 34 ms
52,940 KB
testcase_08 AC 34 ms
53,084 KB
testcase_09 AC 34 ms
52,740 KB
testcase_10 AC 35 ms
52,680 KB
testcase_11 AC 34 ms
53,080 KB
testcase_12 AC 33 ms
52,880 KB
testcase_13 AC 35 ms
52,564 KB
testcase_14 AC 35 ms
52,804 KB
testcase_15 AC 35 ms
52,268 KB
testcase_16 AC 34 ms
52,504 KB
testcase_17 AC 35 ms
53,316 KB
testcase_18 AC 34 ms
52,340 KB
testcase_19 AC 35 ms
52,696 KB
testcase_20 AC 34 ms
52,620 KB
testcase_21 AC 33 ms
53,164 KB
testcase_22 AC 35 ms
52,884 KB
testcase_23 AC 34 ms
53,628 KB
testcase_24 AC 175 ms
301,780 KB
testcase_25 AC 70 ms
176,440 KB
testcase_26 AC 71 ms
177,668 KB
testcase_27 AC 71 ms
176,816 KB
testcase_28 AC 72 ms
177,132 KB
testcase_29 AC 72 ms
176,764 KB
testcase_30 AC 72 ms
177,568 KB
testcase_31 AC 73 ms
176,176 KB
testcase_32 AC 75 ms
176,380 KB
testcase_33 AC 35 ms
52,460 KB
testcase_34 AC 33 ms
53,000 KB
testcase_35 AC 34 ms
53,236 KB
testcase_36 AC 34 ms
53,432 KB
testcase_37 AC 34 ms
52,196 KB
testcase_38 AC 35 ms
52,388 KB
testcase_39 AC 35 ms
52,764 KB
testcase_40 AC 34 ms
52,356 KB
testcase_41 AC 34 ms
52,160 KB
testcase_42 AC 66 ms
176,392 KB
testcase_43 AC 66 ms
176,636 KB
testcase_44 AC 34 ms
53,576 KB
testcase_45 AC 35 ms
52,808 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K=map(int,input().split())
ans=0
P=0
X=K
if 2**(N-1)<=K:
	for i in range(N):
		ans+=2**i
	print(ans)
else:
	
	while P<N:
		ans+=X
		if X%2!=0:
			X+=1
		X//=2
		P+=1
		if X==1:
			break
	print(ans+N-P)	
0