結果

問題 No.2227 King Kraken's Attack
ユーザー buey_tbuey_t
提出日時 2023-02-25 13:03:08
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 1,402 bytes
コンパイル時間 315 ms
コンパイル使用メモリ 82,276 KB
実行使用メモリ 89,912 KB
最終ジャッジ日時 2024-04-10 09:44:51
合計ジャッジ時間 36,348 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
85,048 KB
testcase_01 AC 113 ms
85,316 KB
testcase_02 AC 123 ms
84,988 KB
testcase_03 AC 140 ms
89,668 KB
testcase_04 AC 121 ms
85,388 KB
testcase_05 AC 121 ms
85,184 KB
testcase_06 AC 130 ms
89,460 KB
testcase_07 AC 135 ms
89,912 KB
testcase_08 AC 129 ms
89,652 KB
testcase_09 AC 134 ms
89,524 KB
testcase_10 AC 130 ms
89,576 KB
testcase_11 AC 130 ms
89,344 KB
testcase_12 AC 134 ms
89,452 KB
testcase_13 AC 138 ms
89,640 KB
testcase_14 AC 1,004 ms
89,448 KB
testcase_15 AC 1,035 ms
89,392 KB
testcase_16 AC 944 ms
89,320 KB
testcase_17 AC 1,299 ms
89,892 KB
testcase_18 AC 1,877 ms
89,540 KB
testcase_19 AC 1,197 ms
89,464 KB
testcase_20 AC 1,215 ms
89,668 KB
testcase_21 AC 1,311 ms
89,452 KB
testcase_22 AC 114 ms
85,248 KB
testcase_23 AC 115 ms
85,312 KB
testcase_24 AC 1,304 ms
89,716 KB
testcase_25 AC 1,931 ms
89,596 KB
testcase_26 AC 960 ms
89,744 KB
testcase_27 TLE -
testcase_28 AC 1,310 ms
89,868 KB
testcase_29 AC 1,299 ms
89,536 KB
testcase_30 AC 1,415 ms
89,796 KB
testcase_31 AC 1,301 ms
89,652 KB
testcase_32 AC 1,304 ms
89,456 KB
testcase_33 AC 756 ms
89,600 KB
testcase_34 AC 469 ms
89,744 KB
testcase_35 AC 1,212 ms
89,520 KB
testcase_36 AC 578 ms
89,560 KB
testcase_37 AC 437 ms
89,604 KB
testcase_38 AC 610 ms
89,400 KB
testcase_39 AC 702 ms
89,836 KB
testcase_40 AC 479 ms
89,764 KB
testcase_41 AC 1,686 ms
89,596 KB
testcase_42 AC 441 ms
89,640 KB
testcase_43 AC 485 ms
89,624 KB
testcase_44 AC 1,450 ms
89,396 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(40):
            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