結果
問題 | No.176 2種類の切手 |
ユーザー |
![]() |
提出日時 | 2015-05-25 09:41:56 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 554 bytes |
コンパイル時間 | 776 ms |
コンパイル使用メモリ | 69,964 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-08 03:22:02 |
合計ジャッジ時間 | 1,699 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 29 |
ソースコード
#include <cmath>#include <map>#include <string>#include <vector>#include <set>#include <algorithm>#include <iostream>using namespace std;#define repi(_I, _B, _E) for(int _I = (_B); (_I) < (_E); ++ (_I))#define rep(_I, _N) for(int _I = 0; (_I) < (_N); ++ (_I))#define all(_X) (_X).begin(), (_X).end()using ll = long long;int a, b, t;int main() {cin >> a >> b >> t;ll mi = 2000000000;for ( ll y = 0; y < a && y * b < t + b; ++y ) {ll x = (t - b * y + a - 1)/a;mi = min(mi, a * x + b * y);}cout << mi << endl;return 0;}