結果

問題 No.2227 King Kraken's Attack
ユーザー 👑 timitimi
提出日時 2023-03-08 16:11:18
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 505 bytes
コンパイル時間 180 ms
コンパイル使用メモリ 82,504 KB
実行使用メモリ 67,224 KB
最終ジャッジ日時 2024-04-10 09:51:03
合計ジャッジ時間 3,539 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
53,700 KB
testcase_01 AC 34 ms
52,940 KB
testcase_02 AC 35 ms
52,200 KB
testcase_03 AC 40 ms
60,408 KB
testcase_04 AC 34 ms
52,404 KB
testcase_05 AC 33 ms
52,824 KB
testcase_06 AC 33 ms
52,952 KB
testcase_07 AC 33 ms
52,904 KB
testcase_08 AC 34 ms
52,404 KB
testcase_09 AC 42 ms
61,372 KB
testcase_10 AC 34 ms
52,948 KB
testcase_11 AC 37 ms
52,748 KB
testcase_12 AC 39 ms
60,696 KB
testcase_13 AC 41 ms
60,636 KB
testcase_14 AC 34 ms
52,340 KB
testcase_15 AC 33 ms
52,732 KB
testcase_16 AC 33 ms
53,228 KB
testcase_17 AC 188 ms
61,884 KB
testcase_18 AC 36 ms
52,952 KB
testcase_19 AC 36 ms
53,328 KB
testcase_20 AC 45 ms
60,488 KB
testcase_21 AC 104 ms
62,856 KB
testcase_22 AC 35 ms
52,656 KB
testcase_23 AC 34 ms
52,528 KB
testcase_24 AC 155 ms
63,304 KB
testcase_25 RE -
testcase_26 RE -
testcase_27 AC 33 ms
52,816 KB
testcase_28 AC 55 ms
62,812 KB
testcase_29 AC 46 ms
60,860 KB
testcase_30 AC 49 ms
62,884 KB
testcase_31 AC 61 ms
62,028 KB
testcase_32 AC 48 ms
62,200 KB
testcase_33 AC 48 ms
63,492 KB
testcase_34 AC 43 ms
60,472 KB
testcase_35 AC 56 ms
64,480 KB
testcase_36 AC 43 ms
60,544 KB
testcase_37 AC 35 ms
53,824 KB
testcase_38 AC 36 ms
52,592 KB
testcase_39 AC 34 ms
52,252 KB
testcase_40 AC 34 ms
52,824 KB
testcase_41 AC 34 ms
52,348 KB
testcase_42 AC 36 ms
52,476 KB
testcase_43 AC 35 ms
52,576 KB
testcase_44 AC 36 ms
53,016 KB
testcase_45 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

H,W,LA,LB,KA,KB=map(int, input().split())
if KA==0 and KB==0:
  print((H-1)//LA+(W-1)//LB+2)
  exit()
if KB==0:
  H,W,LA,LB,KA,KB=W,H,LB,LA,KB,KA
import bisect
Y=min((H*W-1)//KA+1,(H-1)//LA+1)
ans=10**10
for y in range(Y+1):
  xx=max(0,H*W-y*KA)
  if xx==0:
    ans=min(ans,y)
  else:
    X=(xx-1)//KB+1
    ng,ok=-1,X+1
    while ok-ng>1:
      mid=(ok+ng)//2
      ko=y*KA+mid*KB+min(H,LA*y)*min(W,LB*mid)
      if ko>=H*W:
        ok=mid
      else:
        ng=mid
    ans=min(ans,y+ok)
print(ans)
    
0