結果

問題 No.208 王将
ユーザー gemmarogemmaro
提出日時 2020-05-05 12:33:53
言語 Elixir
(1.16.2)
結果
WA  
実行時間 -
コード長 446 bytes
コンパイル時間 1,083 ms
コンパイル使用メモリ 54,776 KB
実行使用メモリ 50,440 KB
最終ジャッジ日時 2023-08-30 00:46:35
合計ジャッジ時間 18,586 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 645 ms
49,960 KB
testcase_01 AC 638 ms
49,360 KB
testcase_02 AC 637 ms
49,304 KB
testcase_03 AC 630 ms
49,864 KB
testcase_04 AC 629 ms
49,240 KB
testcase_05 AC 638 ms
49,128 KB
testcase_06 AC 632 ms
49,124 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 627 ms
49,064 KB
testcase_11 AC 630 ms
49,164 KB
testcase_12 AC 619 ms
50,116 KB
testcase_13 AC 630 ms
49,600 KB
testcase_14 AC 613 ms
49,368 KB
testcase_15 AC 630 ms
49,832 KB
testcase_16 AC 640 ms
49,492 KB
testcase_17 AC 628 ms
49,104 KB
testcase_18 AC 622 ms
49,684 KB
testcase_19 AC 632 ms
49,312 KB
testcase_20 AC 627 ms
49,088 KB
testcase_21 AC 627 ms
49,252 KB
testcase_22 AC 607 ms
49,200 KB
testcase_23 AC 622 ms
50,440 KB
testcase_24 AC 625 ms
49,144 KB
権限があれば一括ダウンロードができます

ソースコード

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 && y2 < y -> y + 1
      y == 0 && x2 < x -> x + 1
      x == y && x2 == y2 && x2 < x -> x + 1
      :else -> max(x, y)
    end
  end
end
0