結果

問題 No.773 コンテスト
ユーザー nao22bnao22b
提出日時 2019-04-22 22:49:03
言語 Elixir
(1.16.2)
結果
AC  
実行時間 636 ms / 2,000 ms
コード長 414 bytes
コンパイル時間 1,122 ms
コンパイル使用メモリ 55,420 KB
実行使用メモリ 50,332 KB
最終ジャッジ日時 2023-08-29 23:20:28
合計ジャッジ時間 18,211 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 622 ms
49,316 KB
testcase_01 AC 616 ms
49,188 KB
testcase_02 AC 617 ms
49,404 KB
testcase_03 AC 627 ms
49,164 KB
testcase_04 AC 616 ms
50,144 KB
testcase_05 AC 627 ms
49,968 KB
testcase_06 AC 634 ms
49,116 KB
testcase_07 AC 618 ms
49,144 KB
testcase_08 AC 618 ms
49,780 KB
testcase_09 AC 623 ms
49,488 KB
testcase_10 AC 628 ms
50,064 KB
testcase_11 AC 622 ms
49,736 KB
testcase_12 AC 619 ms
49,980 KB
testcase_13 AC 620 ms
50,332 KB
testcase_14 AC 617 ms
49,168 KB
testcase_15 AC 628 ms
49,204 KB
testcase_16 AC 636 ms
50,280 KB
testcase_17 AC 627 ms
49,796 KB
testcase_18 AC 636 ms
49,788 KB
testcase_19 AC 609 ms
49,164 KB
testcase_20 AC 632 ms
49,116 KB
testcase_21 AC 627 ms
49,800 KB
testcase_22 AC 623 ms
49,788 KB
testcase_23 AC 623 ms
49,040 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

defmodule Main do

    def in_range(a, b, day) do
        case (b < day || a > day) do
            true -> 1
            _ -> 0
        end
    end

    def solve(a, b) do
        List.foldl([23, 24, 25], 0, fn(x, acc) -> acc + in_range(a, b, x) end)
    end

    def main do
        [a, b] = IO.gets("") |> String.trim |> String.split |> Enum.map(&String.to_integer/1)
        solve(a, b) |> IO.puts
    end
end

0