結果
| 問題 |
No.604 誕生日のお小遣い
|
| コンテスト | |
| ユーザー |
fushime2
|
| 提出日時 | 2018-03-07 16:13:09 |
| 言語 | D (dmd 2.109.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 503 bytes |
| コンパイル時間 | 630 ms |
| コンパイル使用メモリ | 104,540 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-13 00:04:22 |
| 合計ジャッジ時間 | 1,430 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 20 WA * 1 |
ソースコード
import std.stdio, std.algorithm, std.string, std.string, std.conv, std.array, std.range, std.math;
long A, B, C;
bool can(long age) {
long x = age / A;
long y = age - x;
return x >= 1.0 * (C - y) / B;
}
void main() {
auto input = readln.split.to!(long[]);
A = input[0]; B = input[1]; C = input[2];
long lb = -1, ub = 10L^^18 + 10;
while (ub - lb > 1) {
long mid = lb + (ub - lb) / 2;
if (can(mid)) ub = mid;
else lb = mid;
}
writeln(ub);
}
fushime2