結果
| 問題 |
No.176 2種類の切手
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-04-04 00:55:15 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 347 bytes |
| コンパイル時間 | 701 ms |
| コンパイル使用メモリ | 54,512 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-08 03:06:58 |
| 合計ジャッジ時間 | 1,515 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 29 |
ソースコード
#include <cstdint>
#include <iostream>
using namespace std;
int main() {
uint64_t A, B, T;
cin >> A >> B >> T;
uint64_t result = 1LL << 60;
for (uint64_t y = 0; y <= A && y <= (T + B - 1) / B; y++) {
uint64_t x = int((T - B * y + A - 1) / A);
uint64_t cost = A * x + B * y;
if (cost < result) result = cost;
}
cout << result << endl;
}