結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 138 ms
85,508 KB
testcase_01 AC 134 ms
85,096 KB
testcase_02 AC 135 ms
85,208 KB
testcase_03 AC 142 ms
85,708 KB
testcase_04 AC 133 ms
85,052 KB
testcase_05 AC 137 ms
85,296 KB
testcase_06 AC 133 ms
85,312 KB
testcase_07 AC 135 ms
85,284 KB
testcase_08 AC 134 ms
85,052 KB
testcase_09 WA -
testcase_10 AC 133 ms
85,316 KB
testcase_11 AC 134 ms
84,928 KB
testcase_12 AC 134 ms
85,364 KB
testcase_13 AC 134 ms
85,108 KB
testcase_14 AC 203 ms
89,208 KB
testcase_15 AC 162 ms
85,648 KB
testcase_16 AC 161 ms
85,712 KB
testcase_17 WA -
testcase_18 AC 133 ms
85,320 KB
testcase_19 AC 149 ms
88,832 KB
testcase_20 AC 153 ms
89,152 KB
testcase_21 AC 158 ms
88,928 KB
testcase_22 AC 141 ms
85,576 KB
testcase_23 AC 134 ms
85,184 KB
testcase_24 AC 159 ms
89,220 KB
testcase_25 AC 132 ms
85,092 KB
testcase_26 WA -
testcase_27 AC 134 ms
85,056 KB
testcase_28 AC 152 ms
89,068 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 154 ms
89,152 KB
testcase_32 AC 152 ms
89,552 KB
testcase_33 AC 151 ms
88,772 KB
testcase_34 WA -
testcase_35 AC 148 ms
89,348 KB
testcase_36 AC 147 ms
89,236 KB
testcase_37 AC 136 ms
85,328 KB
testcase_38 AC 136 ms
84,908 KB
testcase_39 WA -
testcase_40 WA -
testcase_41 AC 140 ms
85,376 KB
testcase_42 AC 139 ms
85,160 KB
testcase_43 WA -
testcase_44 AC 140 ms
85,088 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 = 0
    delete = 0

    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(ans)
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
if __name__ == '__main__':
    main()
0