結果
問題 |
No.176 2種類の切手
|
ユーザー |
|
提出日時 | 2016-10-04 21:17:56 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 600 ms / 1,000 ms |
コード長 | 308 bytes |
コンパイル時間 | 539 ms |
コンパイル使用メモリ | 63,852 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-21 16:50:44 |
合計ジャッジ時間 | 2,041 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 29 |
ソースコード
#include <iostream> using namespace std; template <class T> void setmin(T & a, T const & b) { if (b < a) a = b; } int main() { int a, b, t; cin >> a >> b >> t; int ans = t+b; for (int i = 0; i <= t+b and t < ans; i += b) setmin(ans, i + (t-i + a-1)/a*a); cout << ans << endl; return 0; }