結果
問題 |
No.46 はじめのn歩
|
ユーザー |
|
提出日時 | 2019-01-02 22:38:12 |
言語 | Elixir (1.18.1) |
結果 |
AC
|
実行時間 | 539 ms / 5,000 ms |
コード長 | 394 bytes |
コンパイル時間 | 1,144 ms |
コンパイル使用メモリ | 63,352 KB |
実行使用メモリ | 55,564 KB |
最終ジャッジ日時 | 2024-12-31 02:39:25 |
合計ジャッジ時間 | 7,563 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
コンパイルメッセージ
warning: this clause cannot match because a previous clause at line 8 always matches │ 9 │ _ -> 0 │ ~~~~~~ │ └─ Main.exs:9
ソースコード
defmodule Main do def main do x = IO.gets("") |> String.trim |> String.split(" ", trim: true) |> Enum.map(&String.to_integer/1) case {div(x |> Enum.at(1), x |> Enum.at(0)), rem(x |> Enum.at(1), x |> Enum.at(0))} do {n, 0} -> n {n, _} -> n + 1 _ -> 0 end |> Integer.to_string |> IO.puts end end