結果

問題 No.1517 Party Location
ユーザー mmn15277198
提出日時 2021-05-28 22:48:34
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 266 bytes
コンパイル時間 1,321 ms
コンパイル使用メモリ 165,640 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-11 10:55:04
合計ジャッジ時間 1,859 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int main() {
  long long d;
  cin >> d;
  long long a , b;
  cin >> a >> b;
  long long ans = 1LL << 50;
  for (int x = 0; x <= d; x++) {
    ans = min(ans , x * a + (d - x) * b);
  }
  cout << ans << endl;
  return 0;
}
0