結果

問題 No.1129 Rating じゃんけん
ユーザー penqen
提出日時 2020-12-16 12:15:20
言語 Elixir
(1.19.5)
コンパイル:
elixirc _filename_
実行:
elixir -e Main.main
結果
AC  
実行時間 326 ms / 2,000 ms
コード長 560 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 761 ms
コンパイル使用メモリ 71,940 KB
実行使用メモリ 63,416 KB
最終ジャッジ日時 2026-06-04 16:21:53
合計ジャッジ時間 7,817 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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 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
0