結果

問題 No.476 正しくない平均
ユーザー gemmarogemmaro
提出日時 2020-04-17 09:33:50
言語 Elixir
(1.16.2)
結果
AC  
実行時間 572 ms / 2,000 ms
コード長 327 bytes
コンパイル時間 1,058 ms
コンパイル使用メモリ 55,156 KB
実行使用メモリ 50,244 KB
最終ジャッジ日時 2023-08-30 00:19:42
合計ジャッジ時間 19,235 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 558 ms
49,952 KB
testcase_01 AC 555 ms
49,820 KB
testcase_02 AC 546 ms
49,400 KB
testcase_03 AC 555 ms
49,220 KB
testcase_04 AC 552 ms
49,164 KB
testcase_05 AC 558 ms
49,092 KB
testcase_06 AC 543 ms
49,172 KB
testcase_07 AC 549 ms
49,120 KB
testcase_08 AC 548 ms
49,268 KB
testcase_09 AC 546 ms
49,712 KB
testcase_10 AC 551 ms
49,108 KB
testcase_11 AC 548 ms
49,856 KB
testcase_12 AC 551 ms
50,144 KB
testcase_13 AC 544 ms
48,988 KB
testcase_14 AC 553 ms
49,872 KB
testcase_15 AC 551 ms
49,312 KB
testcase_16 AC 549 ms
49,168 KB
testcase_17 AC 546 ms
50,016 KB
testcase_18 AC 544 ms
49,312 KB
testcase_19 AC 550 ms
49,912 KB
testcase_20 AC 547 ms
50,244 KB
testcase_21 AC 548 ms
49,700 KB
testcase_22 AC 572 ms
50,008 KB
testcase_23 AC 552 ms
49,324 KB
testcase_24 AC 553 ms
49,396 KB
testcase_25 AC 558 ms
49,216 KB
testcase_26 AC 552 ms
49,188 KB
testcase_27 AC 554 ms
49,408 KB
testcase_28 AC 546 ms
49,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

defmodule Main do
  def main do
    1..2
    |> Enum.map(fn _ ->
      IO.read(:line)
      |> String.split()
      |> Enum.map(&String.to_integer/1)
    end)
    |> solve
    |> IO.puts()
  end

  defp solve([[_, a], x]) do
    cond do
      (x |> Enum.sum()) / (x |> length) == a -> "YES"
      true -> "NO"
    end
  end
end
0