結果

問題 No.2227 King Kraken's Attack
ユーザー buey_tbuey_t
提出日時 2023-02-25 13:28:08
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,418 bytes
コンパイル時間 352 ms
コンパイル使用メモリ 82,364 KB
実行使用メモリ 89,556 KB
最終ジャッジ日時 2024-04-10 09:45:44
合計ジャッジ時間 14,997 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 103 ms
85,304 KB
testcase_01 AC 104 ms
85,360 KB
testcase_02 AC 102 ms
84,896 KB
testcase_03 AC 125 ms
89,140 KB
testcase_04 AC 104 ms
85,360 KB
testcase_05 AC 103 ms
85,448 KB
testcase_06 AC 140 ms
89,104 KB
testcase_07 AC 140 ms
88,872 KB
testcase_08 AC 141 ms
88,820 KB
testcase_09 AC 137 ms
89,176 KB
testcase_10 AC 121 ms
89,556 KB
testcase_11 AC 121 ms
88,836 KB
testcase_12 AC 122 ms
89,064 KB
testcase_13 AC 126 ms
89,188 KB
testcase_14 AC 255 ms
89,240 KB
testcase_15 AC 295 ms
89,020 KB
testcase_16 AC 211 ms
89,048 KB
testcase_17 AC 516 ms
89,180 KB
testcase_18 AC 348 ms
89,404 KB
testcase_19 AC 618 ms
89,248 KB
testcase_20 AC 678 ms
88,872 KB
testcase_21 AC 493 ms
89,200 KB
testcase_22 AC 131 ms
85,036 KB
testcase_23 AC 127 ms
85,000 KB
testcase_24 AC 493 ms
88,808 KB
testcase_25 AC 345 ms
89,344 KB
testcase_26 AC 262 ms
89,148 KB
testcase_27 WA -
testcase_28 AC 664 ms
89,024 KB
testcase_29 AC 665 ms
88,928 KB
testcase_30 AC 557 ms
88,900 KB
testcase_31 AC 576 ms
89,216 KB
testcase_32 AC 549 ms
89,052 KB
testcase_33 AC 453 ms
89,152 KB
testcase_34 AC 299 ms
89,328 KB
testcase_35 AC 641 ms
89,556 KB
testcase_36 AC 359 ms
89,024 KB
testcase_37 AC 146 ms
89,020 KB
testcase_38 AC 153 ms
89,224 KB
testcase_39 AC 162 ms
89,108 KB
testcase_40 AC 140 ms
89,052 KB
testcase_41 AC 289 ms
89,168 KB
testcase_42 AC 144 ms
89,084 KB
testcase_43 AC 147 ms
88,896 KB
testcase_44 AC 269 ms
89,340 KB
testcase_45 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    try:
        import pypyjit
        pypyjit.set_param('max_unroll_recursion=-1')
    except:
        pass
    try:
        import sys
        sys.setrecursionlimit(10**7)
    except:
        pass
    from math import sqrt,sin,cos,tan,ceil,radians,floor,gcd,exp,log,log10,log2,factorial,fsum
    import heapq
    from bisect import bisect_left, bisect_right
    import copy
    from collections import deque,Counter,defaultdict
    from itertools import permutations,combinations
    from decimal import Decimal,ROUND_HALF_UP
    #tmp = Decimal(mid).quantize(Decimal('0'), rounding=ROUND_HALF_UP)
    from functools import lru_cache, reduce
    #@lru_cache(maxsize=None)
    from operator import add,sub,mul,xor,and_,or_
    INF = 10**18
    mod1 = 10**9+7
    mod2 = 998244353
    
    #DecimalならPython
    
    H,W,La,Lb,Ka,Kb = map(int, input().split())

    ans = INF

    for i in range(H+1):
        l = 0
        h = W+H
        
        tmp = min(i*La,H)
        
        while h-l > 1:
            m = (l+h)//2
            
            if tmp*min(m*Lb,W) + i*Ka + m*Kb >= H*W:
                h = m
            else:
                l = m
        
        ans = min(ans, h+i)

    print(ans)
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
if __name__ == '__main__':
    main()
0