結果

問題 No.1350 2019-6problem
ユーザー sssr1031sssr1031
提出日時 2022-07-05 21:38:15
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 432 bytes
コンパイル時間 1,874 ms
コンパイル使用メモリ 197,788 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-22 11:57:47
合計ジャッジ時間 3,270 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 WA -
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 WA -
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 1 ms
4,376 KB
testcase_15 AC 1 ms
4,380 KB
testcase_16 AC 1 ms
4,380 KB
testcase_17 WA -
testcase_18 AC 2 ms
4,376 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

using ll = long long;

int main(void) {
  ll a, b, k;
  cin >> a >> b >> k;

  if (a > b) swap(a, b);

  auto f = [&](ll x) {
    x = a * x;

    ll s = x / a;
    ll t = x / b;
    ll u = x / (a * b);

    return s + t - u;
  };

  ll l = 1, r = 1e9;
  while (r - l > 1) {
    ll m = (l + r) / 2;
    if (f(m) <= k) l = m;
    else r = m;
  }

  cout << a * l << endl;
  return 0;
}
0