結果
| 問題 | No.908 うしたぷにきあくん文字列 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-04-17 16:57:08 |
| 言語 | Elixir (1.19.5) |
| 結果 |
AC
|
| 実行時間 | 329 ms / 2,000 ms |
| コード長 | 406 bytes |
| 記録 | |
| コンパイル時間 | 854 ms |
| コンパイル使用メモリ | 72,816 KB |
| 実行使用メモリ | 63,300 KB |
| 最終ジャッジ日時 | 2026-06-04 15:27:04 |
| 合計ジャッジ時間 | 8,734 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 18 |
コンパイルメッセージ
warning: using single-quoted strings to represent charlists is deprecated.
Use ~c"" if you indeed want a charlist or use "" instead.
You may run "mix format --migrate" to change all single-quoted
strings to use the ~c sigil and fix this warning.
│
15 │ t |> Enum.at(2 * i) != ' ' |> hd &&
│ ~
│
└─ Main.exs:15:32
warning: using single-quoted strings to represent charlists is deprecated.
Use ~c"" if you indeed want a charlist or use "" instead.
You may run "mix format --migrate" to change all single-quoted
strings to use the ~c sigil and fix this warning.
│
16 │ t |> Enum.at(2 * i + 1) == ' ' |> hd
│ ~
│
└─ Main.exs:16:40
ソースコード
defmodule Main do
def main do
IO.read(:line)
|> String.trim()
|> solve
|> IO.puts()
end
def solve(s) do
t = s |> String.to_charlist()
cond do
0..((t |> length |> div(2)) - 1)
|> Enum.all?(fn i ->
t |> Enum.at(2 * i) != ' ' |> hd &&
t |> Enum.at(2 * i + 1) == ' ' |> hd
end) ->
"Yes"
true ->
"No"
end
end
end