結果

問題 No.1869 Doubling?
ユーザー 👑 H20H20
提出日時 2022-03-11 21:59:21
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 447 bytes
コンパイル時間 1,086 ms
コンパイル使用メモリ 86,464 KB
実行使用メモリ 79,440 KB
最終ジャッジ日時 2023-10-14 07:09:19
合計ジャッジ時間 9,469 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 149 ms
79,180 KB
testcase_01 AC 150 ms
79,240 KB
testcase_02 AC 151 ms
79,208 KB
testcase_03 AC 153 ms
79,328 KB
testcase_04 AC 155 ms
79,256 KB
testcase_05 AC 154 ms
79,184 KB
testcase_06 AC 151 ms
79,100 KB
testcase_07 AC 153 ms
79,248 KB
testcase_08 AC 150 ms
79,184 KB
testcase_09 WA -
testcase_10 AC 151 ms
79,264 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 151 ms
79,432 KB
testcase_16 AC 154 ms
79,432 KB
testcase_17 AC 151 ms
78,884 KB
testcase_18 AC 151 ms
79,432 KB
testcase_19 AC 152 ms
79,212 KB
testcase_20 AC 152 ms
79,212 KB
testcase_21 AC 152 ms
79,196 KB
testcase_22 AC 151 ms
79,104 KB
testcase_23 AC 153 ms
79,108 KB
testcase_24 AC 152 ms
79,096 KB
testcase_25 AC 154 ms
79,236 KB
testcase_26 AC 153 ms
79,236 KB
testcase_27 AC 153 ms
78,904 KB
testcase_28 AC 155 ms
79,192 KB
testcase_29 AC 148 ms
79,172 KB
testcase_30 AC 154 ms
79,332 KB
testcase_31 AC 158 ms
79,100 KB
testcase_32 AC 153 ms
79,180 KB
testcase_33 AC 154 ms
79,440 KB
testcase_34 AC 153 ms
79,240 KB
testcase_35 AC 155 ms
79,324 KB
testcase_36 AC 153 ms
79,100 KB
testcase_37 AC 156 ms
79,208 KB
testcase_38 AC 156 ms
79,240 KB
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 AC 153 ms
79,440 KB
testcase_43 AC 154 ms
79,180 KB
testcase_44 WA -
testcase_45 AC 152 ms
79,192 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import re
import collections
import sys
sys.setrecursionlimit(10 ** 8)
D = collections.defaultdict(int)
ans = 0
def dfs(n,m,v):
    if D[m]>v+n-1:
        return
    global ans
    D[m]=v+n-1
    n-=1
    v+=m
    if n==0 or m==0:
        ans = max(v,ans)
        return
    if m==1:
        ans = max(v+n,ans)
        return
    dfs(n,-(-m//2),v)
    if m%2==0:
        dfs(n,m//2-1,v)



N,M = map(int, input().split())
dfs(N,M,0)

print(ans)


0