結果
問題 | No.604 誕生日のお小遣い |
ユーザー |
![]() |
提出日時 | 2019-07-06 19:18:34 |
言語 | C++11 (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 464 bytes |
コンパイル時間 | 388 ms |
コンパイル使用メモリ | 55,012 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-01 06:54:19 |
合計ジャッジ時間 | 1,072 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 12 WA * 9 |
ソースコード
#include<iostream> using namespace std; typedef long long ll; static const ll INF=1e18+1; ll A,B,C; bool enough(ll x){ ll res=(x/A)*B+(x-x/A); if(res>=C) return true; else return false; } int main(){ cin >> A >> B >> C; ll left=0; ll right=INF; while(right-left>1){ ll mid=(left+right)/2; if(enough(mid)==true){ right=mid; }else{ left=mid; } } cout << right << endl; }