結果

問題 No.2227 King Kraken's Attack
ユーザー ineedyourlovepineedyourlovep
提出日時 2023-02-24 23:07:02
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 633 bytes
コンパイル時間 1,993 ms
コンパイル使用メモリ 194,932 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-10 09:37:25
合計ジャッジ時間 18,657 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 323 ms
6,816 KB
testcase_01 AC 323 ms
6,944 KB
testcase_02 AC 323 ms
6,940 KB
testcase_03 AC 324 ms
6,940 KB
testcase_04 AC 328 ms
6,944 KB
testcase_05 AC 322 ms
6,940 KB
testcase_06 AC 321 ms
6,940 KB
testcase_07 AC 324 ms
6,940 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 328 ms
6,944 KB
testcase_12 AC 323 ms
6,944 KB
testcase_13 WA -
testcase_14 AC 330 ms
6,944 KB
testcase_15 AC 327 ms
6,944 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 327 ms
6,940 KB
testcase_23 AC 321 ms
6,944 KB
testcase_24 AC 323 ms
6,940 KB
testcase_25 WA -
testcase_26 AC 327 ms
6,940 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 AC 323 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i, a, n) for(ll i = a; i < (n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int INF = 1001001001;
const ll LINF = 1001002003004005006ll;
//const int mod = 1000000007;
//const int mod = 998244353;

int main()
{
  ll h, w, a, b, c, d;
  cin >> h >> w >> a >> b >> c >> d;
  ll ans = LINF;
  rep(i, 0, 1000005) {
    ll ub = LINF, lb = -1;
    while (ub - lb > 1) {
      ll mid = (ub + lb)>>1;
      if (i*c + mid*d + min((ll)i*a, h)*min(mid*b, w) >= h*w) ub = mid;
      else lb = mid;
    }
    ans = min(ans, i + ub);
  }
  cout << ans << endl;
  return 0;
}
0