結果

問題 No.2227 King Kraken's Attack
ユーザー 👑 timitimi
提出日時 2023-03-08 16:13:53
言語 PyPy3
(7.3.15)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 521 bytes
コンパイル時間 203 ms
コンパイル使用メモリ 82,240 KB
実行使用メモリ 64,912 KB
最終ジャッジ日時 2024-04-10 09:51:14
合計ジャッジ時間 3,982 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
53,412 KB
testcase_01 AC 34 ms
53,060 KB
testcase_02 AC 34 ms
52,688 KB
testcase_03 AC 41 ms
60,848 KB
testcase_04 AC 34 ms
53,940 KB
testcase_05 AC 34 ms
52,868 KB
testcase_06 AC 33 ms
52,480 KB
testcase_07 AC 33 ms
52,328 KB
testcase_08 AC 34 ms
52,532 KB
testcase_09 AC 42 ms
61,156 KB
testcase_10 AC 34 ms
52,876 KB
testcase_11 AC 36 ms
52,932 KB
testcase_12 AC 42 ms
59,560 KB
testcase_13 AC 39 ms
60,160 KB
testcase_14 AC 33 ms
52,928 KB
testcase_15 AC 33 ms
52,700 KB
testcase_16 AC 32 ms
52,544 KB
testcase_17 AC 181 ms
61,308 KB
testcase_18 AC 35 ms
53,072 KB
testcase_19 AC 35 ms
52,484 KB
testcase_20 AC 45 ms
60,356 KB
testcase_21 AC 105 ms
61,180 KB
testcase_22 AC 35 ms
52,532 KB
testcase_23 AC 37 ms
52,068 KB
testcase_24 AC 161 ms
62,752 KB
testcase_25 AC 53 ms
59,800 KB
testcase_26 AC 477 ms
64,688 KB
testcase_27 AC 34 ms
53,936 KB
testcase_28 AC 54 ms
61,720 KB
testcase_29 AC 45 ms
60,668 KB
testcase_30 AC 50 ms
63,304 KB
testcase_31 AC 58 ms
61,880 KB
testcase_32 AC 49 ms
62,620 KB
testcase_33 AC 48 ms
61,984 KB
testcase_34 AC 46 ms
60,608 KB
testcase_35 AC 56 ms
64,912 KB
testcase_36 AC 45 ms
60,484 KB
testcase_37 AC 36 ms
52,624 KB
testcase_38 AC 35 ms
53,824 KB
testcase_39 AC 36 ms
53,036 KB
testcase_40 AC 38 ms
53,212 KB
testcase_41 AC 37 ms
53,280 KB
testcase_42 AC 37 ms
52,504 KB
testcase_43 AC 36 ms
52,680 KB
testcase_44 AC 34 ms
52,676 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=(H-1)//LA+1
if KA!=0:
  Y=min((H*W-1)//KA+1,Y)
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