結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 136 ms
85,156 KB
testcase_01 AC 126 ms
85,312 KB
testcase_02 AC 128 ms
85,372 KB
testcase_03 AC 149 ms
89,284 KB
testcase_04 AC 127 ms
85,180 KB
testcase_05 AC 125 ms
85,204 KB
testcase_06 AC 142 ms
89,416 KB
testcase_07 AC 147 ms
89,348 KB
testcase_08 AC 140 ms
89,428 KB
testcase_09 AC 147 ms
89,320 KB
testcase_10 AC 145 ms
89,344 KB
testcase_11 AC 146 ms
89,340 KB
testcase_12 AC 149 ms
89,560 KB
testcase_13 AC 149 ms
89,516 KB
testcase_14 AC 370 ms
89,028 KB
testcase_15 AC 1,066 ms
89,212 KB
testcase_16 AC 371 ms
89,432 KB
testcase_17 AC 1,175 ms
89,316 KB
testcase_18 AC 1,373 ms
89,584 KB
testcase_19 AC 1,522 ms
89,312 KB
testcase_20 AC 1,509 ms
89,588 KB
testcase_21 AC 1,579 ms
89,596 KB
testcase_22 AC 108 ms
85,000 KB
testcase_23 AC 107 ms
84,932 KB
testcase_24 AC 1,237 ms
89,576 KB
testcase_25 TLE -
testcase_26 AC 362 ms
89,192 KB
testcase_27 AC 1,688 ms
89,540 KB
testcase_28 AC 1,543 ms
89,496 KB
testcase_29 AC 1,419 ms
89,584 KB
testcase_30 AC 1,501 ms
89,400 KB
testcase_31 AC 1,348 ms
89,540 KB
testcase_32 AC 1,289 ms
89,540 KB
testcase_33 AC 832 ms
89,492 KB
testcase_34 AC 499 ms
89,256 KB
testcase_35 AC 1,192 ms
89,480 KB
testcase_36 AC 638 ms
89,892 KB
testcase_37 AC 328 ms
89,524 KB
testcase_38 AC 439 ms
89,216 KB
testcase_39 AC 430 ms
89,364 KB
testcase_40 AC 327 ms
89,564 KB
testcase_41 AC 1,310 ms
89,696 KB
testcase_42 AC 364 ms
89,256 KB
testcase_43 AC 408 ms
89,220 KB
testcase_44 AC 1,144 ms
89,540 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 = 10**12
        for _ in range(50):
            m = (l+h)//2
            
            if min(i*La,H)*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