結果
| 問題 | 
                            No.1517 Party Location
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2021-07-22 15:08:04 | 
| 言語 | Elixir  (1.18.1)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 323 bytes | 
| コンパイル時間 | 1,449 ms | 
| コンパイル使用メモリ | 63,120 KB | 
| 実行使用メモリ | 57,704 KB | 
| 最終ジャッジ日時 | 2024-07-17 14:47:12 | 
| 合計ジャッジ時間 | 14,171 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | WA * 2 | 
| other | WA * 13 | 
コンパイルメッセージ
    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:
    │
  7 │     ans = x_list |> Enum.map &(&1 * a + (d - &1) * b) |> IO.inspect
    │                  ~
    │
    └─ Main.exs:7:18
    warning: variable "ans" is unused (if the variable is not meant to be used, prefix it with an underscore)
    │
  7 │     ans = x_list |> Enum.map &(&1 * a + (d - &1) * b) |> IO.inspect
    │     ~~~
    │
    └─ Main.exs:7:5: Main.main/0
            
            ソースコード
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);
    IO.puts x_list;
    ans = x_list |> Enum.map &(&1 * a + (d - &1) * b) |> IO.inspect
  end
end