結果

問題 No.799 赤黒かーどげぇむ
ユーザー gemmarogemmaro
提出日時 2020-04-10 09:49:48
言語 Elixir
(1.16.2)
結果
WA  
実行時間 -
コード長 326 bytes
コンパイル時間 1,029 ms
コンパイル使用メモリ 54,856 KB
実行使用メモリ 50,072 KB
最終ジャッジ日時 2023-08-30 00:05:40
合計ジャッジ時間 14,572 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 607 ms
49,916 KB
testcase_01 AC 601 ms
49,156 KB
testcase_02 AC 603 ms
49,924 KB
testcase_03 AC 600 ms
49,348 KB
testcase_04 AC 602 ms
49,332 KB
testcase_05 AC 602 ms
49,192 KB
testcase_06 AC 602 ms
49,140 KB
testcase_07 WA -
testcase_08 AC 598 ms
49,812 KB
testcase_09 AC 597 ms
49,432 KB
testcase_10 AC 596 ms
49,304 KB
testcase_11 AC 588 ms
49,176 KB
testcase_12 AC 592 ms
49,324 KB
testcase_13 AC 584 ms
50,072 KB
testcase_14 AC 585 ms
49,120 KB
testcase_15 AC 591 ms
49,136 KB
testcase_16 AC 593 ms
49,264 KB
testcase_17 AC 596 ms
49,852 KB
testcase_18 AC 590 ms
49,100 KB
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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