結果
| 問題 |
No.604 誕生日のお小遣い
|
| コンテスト | |
| ユーザー |
fushime2
|
| 提出日時 | 2018-03-07 16:01:15 |
| 言語 | D (dmd 2.109.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 517 bytes |
| コンパイル時間 | 647 ms |
| コンパイル使用メモリ | 102,564 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-06-13 00:04:20 |
| 合計ジャッジ時間 | 1,377 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 12 WA * 9 |
ソースコード
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 * B + y >= C;
}
void main() {
auto input = readln.split.to!(long[]);
A = input[0]; B = input[1]; C = input[2];
long lb = -1, ub = 10L^^18;
while (ub - lb > 1) {
long mid = (lb + ub) / 2;
if (can(mid)) ub = mid;
else lb = mid;
}
writeln(ub);
string _ = readln(); // dbg
}
fushime2