1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

概要

paiza.ioでelixirやってみた。
atcoderやってみた。

参考にしたページ

問題

image.png

サンプルコード

defmodule Main do
	defp find(map), do: 0..2000 |> Enum.find(&!map[&1])
	defp solve(list) do
		list
		|> Enum.reduce(%{}, &Map.put(&2, &1, true))
		|> find()
	end
	defp integer_list(str) do
		str
		|> String.trim()
		|> String.split(" ")
		|> Enum.map(&String.to_integer/1)
	end
	def main do
		IO.read(:line)
		IO.read(:line) 
		|> integer_list()
		|> solve()
		|> IO.puts()
	end
end 
Main.main

成果物

以上。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?