結果

問題 No.1057 素敵な日
ユーザー yukyuyukyu
提出日時 2020-05-30 14:03:51
言語 Elixir
(1.16.2)
結果
AC  
実行時間 635 ms / 2,000 ms
コード長 352 bytes
コンパイル時間 1,071 ms
コンパイル使用メモリ 55,240 KB
実行使用メモリ 50,832 KB
最終ジャッジ日時 2023-08-30 00:52:03
合計ジャッジ時間 7,943 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 624 ms
48,972 KB
testcase_01 AC 624 ms
49,176 KB
testcase_02 AC 635 ms
49,744 KB
testcase_03 AC 628 ms
49,072 KB
testcase_04 AC 620 ms
49,180 KB
testcase_05 AC 623 ms
50,448 KB
testcase_06 AC 629 ms
49,008 KB
testcase_07 AC 620 ms
49,676 KB
testcase_08 AC 628 ms
50,832 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

defmodule Main do
  defp maximun_nice_day([n, m]) when n > m, do: m * 2
  defp maximun_nice_day([n, m]) when n < m, do: n * 2
  defp maximun_nice_day([n, m]) when n == m, do: n * 2 - 1
  def main() do
    IO.gets("")
      |> String.trim
      |> String.split
      |> Enum.map(&String.to_integer/1)
      |> maximun_nice_day
      |> IO.puts
  end
end
0