結果
| 問題 | No.46 はじめのn歩 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-01-02 22:38:12 |
| 言語 | Elixir (1.20.4) |
| 結果 |
AC
不安定
|
| 実行時間 | 302 ms / 5,000 ms |
| + 610µs | |
| コード長 | 394 bytes |
| 記録 | |
| コンパイル時間 | 515 ms |
| コンパイル使用メモリ | 78,512 KB |
| 実行使用メモリ | 67,104 KB |
| 最終ジャッジ日時 | 2026-10-09 19:42:27 |
| 合計ジャッジ時間 | 4,859 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge5_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 |
コンパイルメッセージ
warning: this clause cannot match because a previous clause at line 8 always matches
│
9 │ _ -> 0
│ ~
│
└─ Main.exs:9:11
warning: the following clause cannot match because the previous clauses already matched all possible values:
_ ->
it attempts to match on the result of:
{div(Enum.at(x, 1), Enum.at(x, 0)), rem(Enum.at(x, 1), Enum.at(x, 0))}
which has the already matched type:
dynamic({integer(), integer()})
type warning found at:
│
9 │ _ -> 0
│ ~
│
└─ Main.exs:9:11: Main.main/0
ソースコード
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