結果

問題 No.2138 Add Bacon
ユーザー yukster714
提出日時 2023-05-02 20:17:34
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 280 bytes
コンパイル時間 573 ms
コンパイル使用メモリ 70,760 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-21 08:51:16
合計ジャッジ時間 1,709 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
typedef long long ll;
using namespace std;

int main() {
	int a, b, c, d, e;cin>>a>>b>>c>>d>>e;
	int h = -1e8;
	for(int i = c; i>=0; i--){
		h = max(h, a+i*d-b-i*e);
	}
	cout << h << endl;
	return 0;
}


0