結果
問題 |
No.1129 Rating じゃんけん
|
ユーザー |
|
提出日時 | 2020-12-16 12:13:45 |
言語 | Elixir (1.18.1) |
結果 |
AC
|
実行時間 | 562 ms / 2,000 ms |
コード長 | 597 bytes |
コンパイル時間 | 1,093 ms |
コンパイル使用メモリ | 63,252 KB |
実行使用メモリ | 55,740 KB |
最終ジャッジ日時 | 2024-12-31 05:22:51 |
合計ジャッジ時間 | 12,479 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 16 |
コンパイルメッセージ
warning: this clause for solve/4 cannot match because a previous clause at line 11 always matches │ 13 │ def solve(_, _, _, _), do: :error │ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ │ └─ Main.exs:13
ソースコード
defmodule Main do def main do [a, b, c, d] = IO.read(:line) |> String.trim() |> String.split(" ") |> Enum.map(&String.to_integer/1) solve(a, b, c, d) |> IO.puts() end def solve(a, _b, c, _d) when a < c, do: "tRue" def solve(a, _b, c, _d) when c < a, do: "null" def solve(_a, b, _c, d) when b == d, do: "Draw" def solve(_a, b, _c, d), do: fight(b, d) def solve(_, _, _, _), do: :error def fight(0, 1), do: "null" def fight(0, 2), do: "tRue" def fight(1, 0), do: "tRue" def fight(1, 2), do: "null" def fight(2, 0), do: "null" def fight(2, 1), do: "tRue" end