結果

問題 No.1517 Party Location
ユーザー 遭難者
提出日時 2021-05-05 01:21:02
言語 Java
(openjdk 23)
結果
AC  
実行時間 119 ms / 2,000 ms
コード長 325 bytes
コンパイル時間 2,305 ms
コンパイル使用メモリ 74,508 KB
実行使用メモリ 41,296 KB
最終ジャッジ日時 2024-06-11 10:47:33
合計ジャッジ時間 4,045 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

class Main {
  public static void main(String[] args){
    var sc = new java.util.Scanner(System.in);
    int d = sc.nextInt();
    int a = sc.nextInt();
    int b = sc.nextInt();
    int ans = (int) 1e9 + 7;
    for(int x = 0 ; x <= d ; x++)
      ans = Math.min(ans, x * a + (d - x) * b);
    System.out.println(ans);
  }
}
0