結果

問題 No.176 2種類の切手
ユーザー kimiyuki
提出日時 2016-10-04 21:19:39
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 379 bytes
コンパイル時間 578 ms
コンパイル使用メモリ 66,508 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-11-21 16:50:52
合計ジャッジ時間 3,273 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 28 TLE * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC optimize "O3,omit-frame-pointer,inline"
#include <iostream>
using namespace std;
typedef long long ll;
template <class T> void setmin(T & a, T const & b) { if (b < a) a = b; }
int main() {
    ll a, b, t; cin >> a >> b >> t;
    ll ans = t+b;
    for (ll i = 0; i <= t+b and t < ans; i += b) setmin(ans, i + (t-i + a-1)/a*a);
    cout << ans << endl;
    return 0;
}
0