結果

問題 No.908 うしたぷにきあくん文字列
ユーザー gemmarogemmaro
提出日時 2020-04-17 16:57:08
言語 Elixir
(1.16.2)
結果
AC  
実行時間 633 ms / 2,000 ms
コード長 406 bytes
コンパイル時間 1,225 ms
コンパイル使用メモリ 55,240 KB
実行使用メモリ 50,348 KB
最終ジャッジ日時 2023-08-30 00:20:56
合計ジャッジ時間 15,787 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 628 ms
49,592 KB
testcase_01 AC 631 ms
49,516 KB
testcase_02 AC 621 ms
49,596 KB
testcase_03 AC 628 ms
49,996 KB
testcase_04 AC 621 ms
49,468 KB
testcase_05 AC 626 ms
49,588 KB
testcase_06 AC 619 ms
49,560 KB
testcase_07 AC 623 ms
49,456 KB
testcase_08 AC 633 ms
50,088 KB
testcase_09 AC 620 ms
50,348 KB
testcase_10 AC 627 ms
50,176 KB
testcase_11 AC 624 ms
50,060 KB
testcase_12 AC 617 ms
50,212 KB
testcase_13 AC 619 ms
50,100 KB
testcase_14 AC 628 ms
49,532 KB
testcase_15 AC 626 ms
49,588 KB
testcase_16 AC 626 ms
49,640 KB
testcase_17 AC 630 ms
50,168 KB
testcase_18 AC 625 ms
49,436 KB
testcase_19 AC 627 ms
49,264 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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
0