結果
問題 | No.604 誕生日のお小遣い |
ユーザー |
![]() |
提出日時 | 2019-03-22 00:09:43 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 433 bytes |
コンパイル時間 | 1,574 ms |
コンパイル使用メモリ | 167,516 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-19 02:10:09 |
合計ジャッジ時間 | 2,067 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 12 WA * 9 |
ソースコード
#include<bits/stdc++.h> using namespace std; #define int long long signed main(){ cin.tie(0); ios::sync_with_stdio(false); int a,b,c; cin >> a >> b >> c; function< int(int) > check = [&](int k){ return (k/a * b) + (k - k/a) >= c; }; int ok = 1LL << 60; int ng = -1; while(abs(ok-ng) > 1){ int mid = (ok + ng) / 2; if(check(mid)) ok = mid; else ng = mid; } cout << ok << endl; return 0; }