結果
問題 |
No.2922 Rose Garden
|
ユーザー |
![]() |
提出日時 | 2024-11-12 04:26:29 |
言語 | Elixir (1.18.1) |
結果 |
AC
|
実行時間 | 2,024 ms / 3,000 ms |
コード長 | 519 bytes |
コンパイル時間 | 1,162 ms |
コンパイル使用メモリ | 62,100 KB |
実行使用メモリ | 268,964 KB |
最終ジャッジ日時 | 2024-11-12 04:27:52 |
合計ジャッジ時間 | 74,573 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 50 |
ソースコード
defmodule Main do def input, do: IO.read(:line) |> String.trim def ii, do: input() |> String.to_integer def li, do: input() |> String.split |> Enum.map(&String.to_integer/1) def yn(b), do: IO.puts (if b, do: "Yes", else: "No") def main do [_n, s, b] = li() h = li() init = Enum.at(h, 0) + s*b Enum.reduce_while(h, init, fn x, acc -> if acc < x do {:halt, -1} else {:cont, max(acc, x + s*b)} end end) |> then(fn x -> x > 0 end) |> yn() end end