結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 162 ms
79,624 KB
testcase_01 AC 162 ms
79,544 KB
testcase_02 AC 163 ms
79,628 KB
testcase_03 AC 160 ms
79,316 KB
testcase_04 AC 158 ms
79,648 KB
testcase_05 AC 161 ms
79,600 KB
testcase_06 AC 165 ms
79,628 KB
testcase_07 AC 162 ms
79,628 KB
testcase_08 AC 164 ms
79,660 KB
testcase_09 WA -
testcase_10 AC 163 ms
79,692 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 153 ms
79,536 KB
testcase_16 AC 158 ms
79,652 KB
testcase_17 AC 160 ms
79,644 KB
testcase_18 AC 159 ms
79,536 KB
testcase_19 AC 159 ms
79,716 KB
testcase_20 AC 157 ms
79,652 KB
testcase_21 AC 162 ms
79,600 KB
testcase_22 AC 162 ms
79,688 KB
testcase_23 AC 161 ms
79,468 KB
testcase_24 AC 161 ms
79,572 KB
testcase_25 AC 165 ms
79,600 KB
testcase_26 AC 163 ms
79,620 KB
testcase_27 AC 160 ms
79,664 KB
testcase_28 AC 157 ms
79,664 KB
testcase_29 AC 156 ms
79,768 KB
testcase_30 AC 158 ms
79,604 KB
testcase_31 AC 156 ms
79,652 KB
testcase_32 AC 156 ms
79,692 KB
testcase_33 AC 158 ms
79,540 KB
testcase_34 AC 158 ms
79,588 KB
testcase_35 AC 155 ms
79,592 KB
testcase_36 AC 156 ms
79,668 KB
testcase_37 AC 157 ms
79,512 KB
testcase_38 AC 157 ms
79,520 KB
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 AC 155 ms
79,548 KB
testcase_43 AC 157 ms
79,776 KB
testcase_44 WA -
testcase_45 AC 161 ms
79,620 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]>=m+n-1:
        return
    global ans
    D[m]=m+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