結果

問題 No.207 世界のなんとか
ユーザー 3qvwn3qvwn
提出日時 2019-07-02 00:07:31
言語 Elixir
(1.16.2)
結果
AC  
実行時間 631 ms / 5,000 ms
コード長 357 bytes
コンパイル時間 1,079 ms
コンパイル使用メモリ 55,372 KB
実行使用メモリ 50,216 KB
最終ジャッジ日時 2023-08-29 23:30:07
合計ジャッジ時間 14,592 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 610 ms
49,156 KB
testcase_01 AC 609 ms
49,284 KB
testcase_02 AC 623 ms
50,064 KB
testcase_03 AC 607 ms
49,448 KB
testcase_04 AC 615 ms
49,048 KB
testcase_05 AC 612 ms
50,092 KB
testcase_06 AC 620 ms
49,864 KB
testcase_07 AC 625 ms
50,216 KB
testcase_08 AC 629 ms
49,220 KB
testcase_09 AC 631 ms
49,144 KB
testcase_10 AC 620 ms
49,220 KB
testcase_11 AC 628 ms
49,880 KB
testcase_12 AC 618 ms
49,124 KB
testcase_13 AC 624 ms
49,868 KB
testcase_14 AC 624 ms
49,792 KB
testcase_15 AC 629 ms
49,344 KB
testcase_16 AC 628 ms
49,356 KB
testcase_17 AC 620 ms
49,052 KB
testcase_18 AC 622 ms
49,236 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

defmodule Main do
  def main do
    [a,b] = IO.gets("") |> String.trim |> String.split |> Enum.map(&String.to_integer(&1))
    Enum.map(a..b, fn num -> nabeatu(num) end)
  end
  
  def nabeatu(num) do
    cond do
      rem(num, 3) == 0 -> IO.puts num
      num |> Integer.to_string |> String.contains?("3") -> IO.puts num
      true -> nil
    end
  end
end
0