結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
85,324 KB
testcase_01 AC 120 ms
85,248 KB
testcase_02 AC 121 ms
85,248 KB
testcase_03 AC 121 ms
85,504 KB
testcase_04 AC 123 ms
85,348 KB
testcase_05 AC 123 ms
85,248 KB
testcase_06 AC 129 ms
85,368 KB
testcase_07 AC 124 ms
85,248 KB
testcase_08 AC 125 ms
85,280 KB
testcase_09 WA -
testcase_10 AC 121 ms
85,332 KB
testcase_11 AC 136 ms
85,248 KB
testcase_12 AC 121 ms
85,244 KB
testcase_13 AC 121 ms
85,248 KB
testcase_14 AC 194 ms
89,216 KB
testcase_15 AC 156 ms
85,240 KB
testcase_16 AC 149 ms
85,504 KB
testcase_17 WA -
testcase_18 AC 121 ms
84,864 KB
testcase_19 AC 137 ms
89,472 KB
testcase_20 AC 137 ms
89,116 KB
testcase_21 AC 148 ms
89,088 KB
testcase_22 AC 132 ms
85,504 KB
testcase_23 AC 124 ms
85,316 KB
testcase_24 AC 147 ms
89,088 KB
testcase_25 AC 126 ms
85,476 KB
testcase_26 WA -
testcase_27 AC 124 ms
85,224 KB
testcase_28 AC 139 ms
89,216 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 139 ms
89,216 KB
testcase_32 AC 139 ms
89,088 KB
testcase_33 AC 138 ms
89,088 KB
testcase_34 WA -
testcase_35 AC 137 ms
88,960 KB
testcase_36 AC 139 ms
89,088 KB
testcase_37 AC 121 ms
85,268 KB
testcase_38 AC 124 ms
85,196 KB
testcase_39 WA -
testcase_40 WA -
testcase_41 AC 123 ms
85,248 KB
testcase_42 AC 124 ms
84,928 KB
testcase_43 AC 122 ms
85,120 KB
testcase_44 AC 124 ms
84,992 KB
testcase_45 AC 124 ms
84,864 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