結果

問題 No.224 文字列変更(easy)
ユーザー gemmarogemmaro
提出日時 2020-04-17 17:16:23
言語 Elixir
(1.16.2)
結果
AC  
実行時間 573 ms / 5,000 ms
コード長 362 bytes
コンパイル時間 1,131 ms
コンパイル使用メモリ 54,704 KB
実行使用メモリ 50,456 KB
最終ジャッジ日時 2023-08-30 00:21:57
合計ジャッジ時間 15,402 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 562 ms
49,312 KB
testcase_01 AC 570 ms
49,880 KB
testcase_02 AC 569 ms
49,716 KB
testcase_03 AC 553 ms
49,236 KB
testcase_04 AC 562 ms
49,468 KB
testcase_05 AC 559 ms
49,804 KB
testcase_06 AC 553 ms
49,312 KB
testcase_07 AC 554 ms
49,228 KB
testcase_08 AC 559 ms
50,144 KB
testcase_09 AC 553 ms
49,076 KB
testcase_10 AC 558 ms
49,236 KB
testcase_11 AC 557 ms
50,264 KB
testcase_12 AC 552 ms
49,196 KB
testcase_13 AC 560 ms
50,176 KB
testcase_14 AC 559 ms
49,228 KB
testcase_15 AC 562 ms
49,796 KB
testcase_16 AC 563 ms
49,300 KB
testcase_17 AC 572 ms
49,484 KB
testcase_18 AC 573 ms
49,620 KB
testcase_19 AC 570 ms
49,400 KB
testcase_20 AC 572 ms
49,500 KB
testcase_21 AC 570 ms
50,456 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

defmodule Main do
  def main do
    1..3
    |> Enum.map(fn _ ->
      IO.read(:line)
      |> String.trim()
    end)
    |> solve
    |> IO.puts()
  end

  def solve([n, s, t]) do
    0..((n |> String.to_integer()) - 1)
    |> Enum.count(fn i ->
      s |> String.to_charlist() |> Enum.at(i) !=
        t |> String.to_charlist() |> Enum.at(i)
    end)
  end
end
0