結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
85,032 KB
testcase_01 AC 118 ms
85,368 KB
testcase_02 AC 120 ms
85,192 KB
testcase_03 AC 120 ms
85,300 KB
testcase_04 AC 120 ms
85,364 KB
testcase_05 AC 117 ms
85,460 KB
testcase_06 AC 119 ms
85,392 KB
testcase_07 AC 118 ms
85,312 KB
testcase_08 AC 116 ms
85,424 KB
testcase_09 WA -
testcase_10 AC 114 ms
85,328 KB
testcase_11 AC 110 ms
85,368 KB
testcase_12 AC 115 ms
85,456 KB
testcase_13 AC 115 ms
84,920 KB
testcase_14 AC 170 ms
89,164 KB
testcase_15 AC 133 ms
85,572 KB
testcase_16 AC 134 ms
85,832 KB
testcase_17 WA -
testcase_18 AC 116 ms
85,376 KB
testcase_19 AC 128 ms
89,244 KB
testcase_20 AC 125 ms
89,292 KB
testcase_21 AC 130 ms
89,172 KB
testcase_22 AC 115 ms
85,624 KB
testcase_23 AC 117 ms
85,564 KB
testcase_24 AC 131 ms
89,124 KB
testcase_25 AC 108 ms
84,960 KB
testcase_26 WA -
testcase_27 AC 113 ms
84,920 KB
testcase_28 AC 125 ms
89,120 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 124 ms
89,228 KB
testcase_32 AC 139 ms
89,232 KB
testcase_33 AC 131 ms
89,364 KB
testcase_34 WA -
testcase_35 AC 131 ms
89,144 KB
testcase_36 AC 128 ms
89,252 KB
testcase_37 AC 114 ms
85,388 KB
testcase_38 AC 111 ms
85,348 KB
testcase_39 WA -
testcase_40 WA -
testcase_41 AC 113 ms
85,300 KB
testcase_42 AC 111 ms
85,036 KB
testcase_43 AC 111 ms
84,932 KB
testcase_44 AC 113 ms
85,256 KB
testcase_45 AC 112 ms
85,184 KB
権限があれば一括ダウンロードができます

ソースコード

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 = 0
    delete = 0
    
    
    tmp = INF
    if Ka == 0 and Kb == 0:
        pass
    elif Ka == 0:
        tmp = (H*W+Kb-1)//Kb
    elif Kb == 0:
        tmp = (H*W+Ka-1)//Ka
    else:
        tmp = min((H*W+Ka-1)//Ka, (H*W+Kb-1)//Kb)
    
    
    if H >= W:
        W2 = W
        while H > 0 and W2 > 0:
            ans += 1
            
            W2 -= Lb
            delete += Kb
            H -= delete//W
            delete %= W
        
        while H > 0:
            ans += 1
            H -= La
            delete += Ka
            H -= delete//W
            delete %= W
    else:
        H2 = H
        while W > 0 and H2 > 0:
            ans += 1
            
            H2 -= La
            delete += Ka
            W -= delete//H
            delete %= H
        
        while W > 0:
            ans += 1
            W -= Lb
            delete += Kb
            W -= delete//H
            delete %= H
            
    print(min(ans,tmp))
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
if __name__ == '__main__':
    main()
0