結果

問題 No.1517 Party Location
ユーザー shojin
提出日時 2024-05-08 21:03:52
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 211 bytes
コンパイル時間 3,272 ms
コンパイル使用メモリ 273,496 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-12-15 04:26:11
合計ジャッジ時間 3,717 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main(){
  int d, a, b;
  cin >> d >> a >> b;
  
  int ans = 1e9;
  for(int x = 0; x <= d; x++){
    ans = min(ans, x * a + (d - x) * b);
  }
  
  cout << ans;
}
0