結果

問題 No.208 王将
ユーザー gemmarogemmaro
提出日時 2020-05-05 12:31:14
言語 Elixir
(1.16.2)
結果
WA  
実行時間 -
コード長 416 bytes
コンパイル時間 1,061 ms
コンパイル使用メモリ 55,668 KB
実行使用メモリ 50,184 KB
最終ジャッジ日時 2023-08-30 00:46:09
合計ジャッジ時間 17,994 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 600 ms
49,544 KB
testcase_01 AC 610 ms
49,328 KB
testcase_02 AC 617 ms
49,140 KB
testcase_03 AC 620 ms
49,220 KB
testcase_04 AC 615 ms
49,024 KB
testcase_05 AC 615 ms
49,588 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 616 ms
49,204 KB
testcase_11 AC 612 ms
49,124 KB
testcase_12 AC 612 ms
49,360 KB
testcase_13 AC 619 ms
49,108 KB
testcase_14 AC 611 ms
49,248 KB
testcase_15 AC 613 ms
49,020 KB
testcase_16 AC 618 ms
49,116 KB
testcase_17 AC 614 ms
49,312 KB
testcase_18 AC 617 ms
49,240 KB
testcase_19 AC 617 ms
49,228 KB
testcase_20 AC 607 ms
50,184 KB
testcase_21 AC 619 ms
49,760 KB
testcase_22 AC 621 ms
49,828 KB
testcase_23 AC 617 ms
49,200 KB
testcase_24 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

defmodule Main do
  def main do
    [{x, _}, {y, _}] = IO.read(:line) |> String.split() |> Enum.map(&Integer.parse/1)
    [{x2, _}, {y2, _}] = IO.read(:line) |> String.split() |> Enum.map(&Integer.parse/1)

    solve(x, y, x2, y2)
    |> IO.puts()
  end

  def solve(x, y, x2, y2) do
    cond do
      x == 0 -> y + 1
      y == 0 -> x + 1
      x == y && x2 == y2 -> x + 1
      :else -> max(x, y)
    end
  end
end
0