結果
問題 |
No.1517 Party Location
|
ユーザー |
|
提出日時 | 2021-07-22 15:16:47 |
言語 | Elixir (1.18.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 320 bytes |
コンパイル時間 | 1,240 ms |
コンパイル使用メモリ | 66,904 KB |
実行使用メモリ | 55,168 KB |
最終ジャッジ日時 | 2024-07-17 14:47:51 |
合計ジャッジ時間 | 11,512 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 1 |
other | AC * 2 WA * 11 |
コンパイルメッセージ
warning: parentheses are required when piping into a function call. For example: foo 1 |> bar 2 |> baz 3 is ambiguous and should be written as foo(1) |> bar(2) |> baz(3) Ambiguous pipe found at: │ 6 │ ans = x_list |> Enum.map &(&1 * a + (d - &1) * b); │ ~ │ └─ Main.exs:6:18
ソースコード
defmodule Main do def main do d = IO.read(:line) |> String.trim |> String.to_integer; [a, b] = IO.read(:line) |> String.trim |> String.split(" ") |> Enum.map(&String.to_integer/1) x_list = Enum.to_list(0..d+1); ans = x_list |> Enum.map &(&1 * a + (d - &1) * b); Enum.max(ans) |> IO.puts; end end