結果

問題 No.1869 Doubling?
ユーザー a aa a
提出日時 2022-10-05 01:47:43
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 347 bytes
コンパイル時間 93 ms
コンパイル使用メモリ 10,708 KB
実行使用メモリ 8,632 KB
最終ジャッジ日時 2023-08-29 01:07:57
合計ジャッジ時間 3,086 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,764 KB
testcase_01 AC 16 ms
7,772 KB
testcase_02 AC 16 ms
8,108 KB
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 AC 15 ms
7,848 KB
testcase_07 AC 16 ms
7,892 KB
testcase_08 AC 16 ms
7,828 KB
testcase_09 WA -
testcase_10 AC 16 ms
7,824 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
testcase_30 RE -
testcase_31 RE -
testcase_32 RE -
testcase_33 AC 15 ms
7,760 KB
testcase_34 AC 16 ms
7,820 KB
testcase_35 AC 16 ms
7,924 KB
testcase_36 AC 15 ms
7,760 KB
testcase_37 AC 15 ms
7,860 KB
testcase_38 AC 15 ms
7,764 KB
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 RE -
testcase_43 AC 16 ms
7,816 KB
testcase_44 AC 15 ms
7,836 KB
testcase_45 AC 15 ms
7,880 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m=list (map(int,input ().split()))
def f(x,y):
    def a(x,y):
        if x==1:
            return 1
        return min(2*a(x-1,y),y,)
    if x==1:
        return 1
    elif y%2==0:
        return f(x-1,int(y/2))+a(x-1,int(y/2))*2
    elif y==1:
        return x
    else:
        return f(x-1,int((y+1)/2))+a(x-1,int((1+y)/2))*2-1
print(f(n,m))
0