結果

問題 No.176 2種類の切手
ユーザー たこし
提出日時 2015-06-07 23:01:38
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 847 bytes
コンパイル時間 695 ms
コンパイル使用メモリ 90,632 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-08 03:23:28
合計ジャッジ時間 1,642 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 25 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <fstream>
#include <queue>
#include <complex>

#define INF 1145141919
#define INF_INT_MAX 2147483647
#define INF_LL_MAX 9223372036854775807
#define EPS 1e-10
#define Pi acos(-1)
#define LL long long
#define ULL unsigned long long

using namespace std;

LL A, B, T;

int main() {

	cin >> A >> B >> T;

	LL ans = INF_LL_MAX;

	for (LL i = 0; i <= A && B*i <= T; i++){
		ans = min(ans, B*i + A*((T - B*i + A - 1) / A));
	}

	cout << ans << endl;

	return 0;
}
0