結果

問題 No.1517 Party Location
ユーザー 遭難者遭難者
提出日時 2021-05-05 01:21:02
言語 Java21
(openjdk 21)
結果
AC  
実行時間 119 ms / 2,000 ms
コード長 325 bytes
コンパイル時間 1,909 ms
コンパイル使用メモリ 73,616 KB
実行使用メモリ 56,300 KB
最終ジャッジ日時 2023-09-02 04:04:24
合計ジャッジ時間 4,459 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 116 ms
55,408 KB
testcase_01 AC 114 ms
55,452 KB
testcase_02 AC 117 ms
56,300 KB
testcase_03 AC 115 ms
55,920 KB
testcase_04 AC 115 ms
55,852 KB
testcase_05 AC 115 ms
55,820 KB
testcase_06 AC 115 ms
55,888 KB
testcase_07 AC 114 ms
55,832 KB
testcase_08 AC 119 ms
55,560 KB
testcase_09 AC 116 ms
55,804 KB
testcase_10 AC 115 ms
55,488 KB
testcase_11 AC 116 ms
56,008 KB
testcase_12 AC 112 ms
56,136 KB
testcase_13 AC 113 ms
55,784 KB
testcase_14 AC 116 ms
56,088 KB
権限があれば一括ダウンロードができます

ソースコード

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