結果

問題 No.560 ふしぎなナップサック
ユーザー YuyaYAMAMOTOYuyaYAMAMOTO
提出日時 2017-09-05 21:51:27
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 199 bytes
コンパイル時間 83 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 11,136 KB
最終ジャッジ日時 2024-04-24 14:07:55
合計ジャッジ時間 1,135 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
10,624 KB
testcase_01 AC 30 ms
10,624 KB
testcase_02 AC 30 ms
10,752 KB
testcase_03 AC 30 ms
10,624 KB
testcase_04 AC 27 ms
10,624 KB
testcase_05 RE -
testcase_06 AC 24 ms
10,880 KB
testcase_07 AC 25 ms
10,752 KB
testcase_08 AC 25 ms
10,752 KB
testcase_09 AC 25 ms
10,752 KB
testcase_10 AC 26 ms
10,752 KB
testcase_11 AC 28 ms
10,752 KB
testcase_12 AC 27 ms
10,752 KB
testcase_13 AC 25 ms
10,880 KB
testcase_14 AC 25 ms
10,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def knapsack(m, n):
    
    if n !=0:
        exp_n = (3*knapsack(m, n-1)+1) / 3
    
    elif n == 0:
        exp_n = m
    
    return exp_n

m, n = map(int, input().split())
print(knapsack(m, n))
0