結果

問題 No.1517 Party Location
ユーザー yuruhiyayuruhiya
提出日時 2021-05-28 20:22:37
言語 Crystal
(1.11.2)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 103 bytes
コンパイル時間 22,622 ms
コンパイル使用メモリ 252,956 KB
実行使用メモリ 4,516 KB
最終ジャッジ日時 2023-09-02 04:07:07
合計ジャッジ時間 23,595 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,380 KB
testcase_01 AC 3 ms
4,400 KB
testcase_02 AC 2 ms
4,444 KB
testcase_03 AC 2 ms
4,412 KB
testcase_04 AC 2 ms
4,412 KB
testcase_05 AC 3 ms
4,516 KB
testcase_06 AC 2 ms
4,388 KB
testcase_07 AC 3 ms
4,416 KB
testcase_08 AC 3 ms
4,408 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 3 ms
4,380 KB
testcase_11 AC 3 ms
4,380 KB
testcase_12 AC 2 ms
4,440 KB
testcase_13 AC 3 ms
4,408 KB
testcase_14 AC 2 ms
4,384 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

d = read_line.to_i
a, b = read_line.split.map(&.to_i)
puts (0..d).min_of { |x|
  a * x + (d - x) * b
}
0