結果
問題 |
No.604 誕生日のお小遣い
|
ユーザー |
![]() |
提出日時 | 2019-07-06 19:22:41 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 475 bytes |
コンパイル時間 | 505 ms |
コンパイル使用メモリ | 55,012 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-25 15:54:50 |
合計ジャッジ時間 | 1,503 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 14 WA * 7 |
ソースコード
#include<iostream> using namespace std; typedef unsigned long long int 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=C; while(right-left>1){ ll mid=(left+right)/2; if(enough(mid)==true){ right=mid; }else{ left=mid; } } cout << right << endl; }