結果
| 問題 |
No.1350 2019-6problem
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-07-05 21:38:15 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 432 bytes |
| コンパイル時間 | 1,784 ms |
| コンパイル使用メモリ | 191,564 KB |
| 最終ジャッジ日時 | 2025-01-30 04:52:19 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 12 WA * 9 |
ソースコード
#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;
}