結果
問題 |
No.604 誕生日のお小遣い
|
ユーザー |
👑 |
提出日時 | 2019-04-30 12:24:07 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 601 bytes |
コンパイル時間 | 713 ms |
コンパイル使用メモリ | 72,128 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-12-29 17:03:05 |
合計ジャッジ時間 | 1,789 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 12 WA * 9 |
ソースコード
#include <cstdio> #include <cstdlib> #include <cstddef> #include <vector> #include <algorithm> #include <cmath> #include <string> #include <iostream> #include <iomanip> #define L64 long long #define MOD (1000000007LL) L64 check(L64 age, L64 a, L64 b) { L64 z = age / a; return z * b + age - z; } int main(void) { L64 a, b, c; std::cin >> a >> b >> c; L64 min, max; min = 0; max = c; while(1LL < max - min){ L64 mid = (min + max) / 2LL; L64 score = check(mid, a, b); if(score < c){ min = mid; } else { max = mid; } } std::cout << max << std::endl; }