結果

問題 No.739 大事なことなので2度言います
ユーザー gemmarogemmaro
提出日時 2020-04-17 09:54:25
言語 Elixir
(1.16.2)
結果
AC  
実行時間 637 ms / 2,000 ms
コード長 337 bytes
コンパイル時間 1,212 ms
コンパイル使用メモリ 54,832 KB
実行使用メモリ 50,432 KB
最終ジャッジ日時 2023-08-30 00:19:04
合計ジャッジ時間 9,885 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 620 ms
49,648 KB
testcase_01 AC 617 ms
49,284 KB
testcase_02 AC 637 ms
50,432 KB
testcase_03 AC 623 ms
49,456 KB
testcase_04 AC 630 ms
49,384 KB
testcase_05 AC 631 ms
49,328 KB
testcase_06 AC 636 ms
49,468 KB
testcase_07 AC 614 ms
49,320 KB
testcase_08 AC 615 ms
49,932 KB
testcase_09 AC 615 ms
49,900 KB
testcase_10 AC 606 ms
50,124 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

defmodule Main do
  def main do
    IO.read(:line)
    |> String.trim()
    |> solve
    |> IO.puts()
  end

  defp solve(s) do
    u = s |> String.to_charlist()
    t = u |> length |> div(2)

    cond do
      u |> Enum.slice(0..(t - 1)) ==
          u |> Enum.slice(t..-1) ->
        "YES"

      true ->
        "NO"
    end
  end
end
0