結果

問題 No.176 2種類の切手
ユーザー vain0vain0
提出日時 2015-05-25 09:29:26
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 633 bytes
コンパイル時間 517 ms
コンパイル使用メモリ 69,972 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-16 22:12:15
合計ジャッジ時間 1,366 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 1 ms
6,940 KB
testcase_03 AC 1 ms
6,944 KB
testcase_04 AC 2 ms
6,944 KB
testcase_05 AC 2 ms
6,944 KB
testcase_06 AC 2 ms
6,944 KB
testcase_07 AC 2 ms
6,944 KB
testcase_08 AC 2 ms
6,944 KB
testcase_09 AC 1 ms
6,940 KB
testcase_10 AC 1 ms
6,940 KB
testcase_11 AC 1 ms
6,940 KB
testcase_12 AC 2 ms
6,940 KB
testcase_13 AC 2 ms
6,944 KB
testcase_14 AC 1 ms
6,940 KB
testcase_15 WA -
testcase_16 AC 1 ms
6,940 KB
testcase_17 WA -
testcase_18 AC 1 ms
6,944 KB
testcase_19 AC 1 ms
6,944 KB
testcase_20 AC 2 ms
6,940 KB
testcase_21 AC 1 ms
6,940 KB
testcase_22 AC 2 ms
6,944 KB
testcase_23 AC 1 ms
6,940 KB
testcase_24 AC 1 ms
6,940 KB
testcase_25 AC 1 ms
6,940 KB
testcase_26 AC 1 ms
6,944 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 1 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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()

int a, b, t;
int main() {
	cin >> a >> b >> t;

	int c = a + b;
	int ccnt = t / c;
	int u = t - ccnt * c;

	int m = 2000000000;
	int acnt = ((u + a - 1) / a);
	int bcnt = ((u + b - 1) / b);
	m = min(m, (ccnt + 1) * c);
	m = min(m, acnt * a + ccnt * c);
	m = min(m, bcnt * b + ccnt * c);
	cout << m << endl;

	return 0;
}
0