結果
問題 | No.2227 King Kraken's Attack |
ユーザー | buey_t |
提出日時 | 2023-02-25 13:31:09 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 718 ms / 2,000 ms |
コード長 | 1,628 bytes |
コンパイル時間 | 1,059 ms |
コンパイル使用メモリ | 82,308 KB |
実行使用メモリ | 89,472 KB |
最終ジャッジ日時 | 2024-10-02 11:36:40 |
合計ジャッジ時間 | 16,546 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 117 ms
85,196 KB |
testcase_01 | AC | 119 ms
84,992 KB |
testcase_02 | AC | 120 ms
85,240 KB |
testcase_03 | AC | 143 ms
88,872 KB |
testcase_04 | AC | 115 ms
85,196 KB |
testcase_05 | AC | 119 ms
85,120 KB |
testcase_06 | AC | 134 ms
89,088 KB |
testcase_07 | AC | 132 ms
89,020 KB |
testcase_08 | AC | 131 ms
88,820 KB |
testcase_09 | AC | 132 ms
89,036 KB |
testcase_10 | AC | 134 ms
89,344 KB |
testcase_11 | AC | 134 ms
88,704 KB |
testcase_12 | AC | 140 ms
89,028 KB |
testcase_13 | AC | 139 ms
89,472 KB |
testcase_14 | AC | 255 ms
89,148 KB |
testcase_15 | AC | 279 ms
88,760 KB |
testcase_16 | AC | 237 ms
88,832 KB |
testcase_17 | AC | 544 ms
88,960 KB |
testcase_18 | AC | 337 ms
88,960 KB |
testcase_19 | AC | 653 ms
89,320 KB |
testcase_20 | AC | 650 ms
88,864 KB |
testcase_21 | AC | 548 ms
88,960 KB |
testcase_22 | AC | 120 ms
85,120 KB |
testcase_23 | AC | 120 ms
85,404 KB |
testcase_24 | AC | 477 ms
88,960 KB |
testcase_25 | AC | 362 ms
88,960 KB |
testcase_26 | AC | 241 ms
89,088 KB |
testcase_27 | AC | 254 ms
88,960 KB |
testcase_28 | AC | 641 ms
89,192 KB |
testcase_29 | AC | 683 ms
89,216 KB |
testcase_30 | AC | 625 ms
88,960 KB |
testcase_31 | AC | 643 ms
88,800 KB |
testcase_32 | AC | 614 ms
89,088 KB |
testcase_33 | AC | 515 ms
89,472 KB |
testcase_34 | AC | 333 ms
89,088 KB |
testcase_35 | AC | 718 ms
89,344 KB |
testcase_36 | AC | 401 ms
89,216 KB |
testcase_37 | AC | 156 ms
88,960 KB |
testcase_38 | AC | 167 ms
88,680 KB |
testcase_39 | AC | 180 ms
88,960 KB |
testcase_40 | AC | 156 ms
88,960 KB |
testcase_41 | AC | 322 ms
88,816 KB |
testcase_42 | AC | 155 ms
88,960 KB |
testcase_43 | AC | 164 ms
88,844 KB |
testcase_44 | AC | 285 ms
88,832 KB |
testcase_45 | AC | 119 ms
85,120 KB |
ソースコード
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 if Ka == 0 and Kb == 0: pass elif Ka == 0: ans = (H*W+Kb-1)//Kb elif Kb == 0: ans = (H*W+Ka-1)//Ka else: ans = min((H*W+Ka-1)//Ka, (H*W+Kb-1)//Kb) for i in range(H+1): l = 0 h = W+H+1 tmp = min(i*La,H) while h-l > 1: m = (l+h)//2 if tmp*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()