結果

問題 No.799 赤黒かーどげぇむ
ユーザー gemmarogemmaro
提出日時 2020-04-10 10:04:02
言語 Elixir
(1.16.2)
結果
AC  
実行時間 633 ms / 2,000 ms
コード長 460 bytes
コンパイル時間 1,158 ms
コンパイル使用メモリ 55,432 KB
実行使用メモリ 50,280 KB
最終ジャッジ日時 2023-08-30 00:05:56
合計ジャッジ時間 15,435 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 617 ms
50,280 KB
testcase_01 AC 625 ms
49,796 KB
testcase_02 AC 625 ms
49,844 KB
testcase_03 AC 628 ms
49,156 KB
testcase_04 AC 628 ms
49,884 KB
testcase_05 AC 620 ms
49,804 KB
testcase_06 AC 621 ms
49,996 KB
testcase_07 AC 613 ms
49,836 KB
testcase_08 AC 611 ms
49,336 KB
testcase_09 AC 591 ms
49,188 KB
testcase_10 AC 612 ms
49,796 KB
testcase_11 AC 608 ms
49,180 KB
testcase_12 AC 622 ms
50,132 KB
testcase_13 AC 610 ms
48,984 KB
testcase_14 AC 628 ms
49,648 KB
testcase_15 AC 622 ms
49,180 KB
testcase_16 AC 629 ms
49,276 KB
testcase_17 AC 633 ms
50,084 KB
testcase_18 AC 626 ms
49,932 KB
testcase_19 AC 624 ms
49,508 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

defmodule Main do
  def main do
    IO.gets("")
    |> String.split()
    |> Enum.map(&String.to_integer(&1))
    |> (fn [a, b, c, d] ->
          cond do
            a > c -> [c, d, a, b]
            true -> [a, b, c, d]
          end
        end).()
    |> (fn [a, b, c, d] ->
          (b - a + 1) * (d - c + 1) -
            cond do
              b < c -> 0
              true -> min(b, d) - c + 1
            end
        end).()
    |> IO.puts()
  end
end
0