結果

問題 No.1129 Rating じゃんけん
ユーザー penqenpenqen
提出日時 2020-12-16 12:15:20
言語 Elixir
(1.16.2)
結果
AC  
実行時間 606 ms / 2,000 ms
コード長 560 bytes
コンパイル時間 1,057 ms
コンパイル使用メモリ 55,376 KB
実行使用メモリ 50,280 KB
最終ジャッジ日時 2023-08-30 01:05:17
合計ジャッジ時間 13,876 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 593 ms
49,764 KB
testcase_01 AC 596 ms
49,728 KB
testcase_02 AC 591 ms
49,332 KB
testcase_03 AC 599 ms
49,908 KB
testcase_04 AC 593 ms
49,108 KB
testcase_05 AC 588 ms
49,252 KB
testcase_06 AC 590 ms
49,432 KB
testcase_07 AC 595 ms
49,488 KB
testcase_08 AC 597 ms
49,252 KB
testcase_09 AC 597 ms
49,384 KB
testcase_10 AC 606 ms
49,356 KB
testcase_11 AC 597 ms
49,856 KB
testcase_12 AC 600 ms
49,228 KB
testcase_13 AC 598 ms
50,016 KB
testcase_14 AC 606 ms
50,280 KB
testcase_15 AC 604 ms
49,276 KB
testcase_16 AC 600 ms
50,000 KB
testcase_17 AC 598 ms
49,352 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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