結果
| 問題 |
No.2138 Add Bacon
|
| コンテスト | |
| ユーザー |
tnakao0123
|
| 提出日時 | 2022-12-02 23:34:18 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| コード長 | 486 bytes |
| コンパイル時間 | 308 ms |
| コンパイル使用メモリ | 41,344 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-10 02:02:02 |
| 合計ジャッジ時間 | 1,292 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 25 |
ソースコード
/* -*- coding: utf-8 -*-
*
* 2138.cc: No.2138 Add Bacon - yukicoder
*/
#include<cstdio>
#include<algorithm>
using namespace std;
/* constant */
const int INF = 1 << 30;
/* typedef */
/* global variables */
/* subroutines */
/* main */
int main() {
int a, b, c, d, e;
scanf("%d%d%d%d%d", &a, &b, &c, &d, &e);
int maxh = -INF;
for (int i = 0; i <= c; i++) {
int h = (a + d * i) - (b + e * i);
maxh = max(maxh, h);
}
printf("%d\n", maxh);
return 0;
}
tnakao0123