結果

問題 No.975 ミスターマックスバリュ
ユーザー penqenpenqen
提出日時 2020-12-24 23:47:18
言語 Elixir
(1.16.2)
結果
AC  
実行時間 629 ms / 2,000 ms
コード長 593 bytes
コンパイル時間 1,012 ms
コンパイル使用メモリ 55,084 KB
実行使用メモリ 58,660 KB
最終ジャッジ日時 2023-08-30 01:13:42
合計ジャッジ時間 9,008 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 610 ms
49,796 KB
testcase_01 AC 616 ms
49,980 KB
testcase_02 AC 620 ms
49,408 KB
testcase_03 AC 609 ms
49,856 KB
testcase_04 AC 610 ms
49,380 KB
testcase_05 AC 607 ms
49,180 KB
testcase_06 AC 608 ms
49,152 KB
testcase_07 AC 606 ms
49,056 KB
testcase_08 AC 629 ms
58,660 KB
testcase_09 AC 599 ms
49,440 KB
testcase_10 AC 609 ms
49,852 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

defmodule Main do
  def main do
    [x, n, m] = IO.read(:line) |> String.trim() |> String.split(" ") |> Enum.map(&String.to_integer/1)
    an = IO.read(:line) |> String.trim() |> String.split(" ") |> Enum.map(&String.to_integer/1)
    bm = IO.read(:line) |> String.trim() |> String.split(" ") |> Enum.map(&String.to_integer/1)
    solve(x, n, m, an, bm) |> IO.puts() 
  end

  def solve(x, _n, _m, an, bm) do
    case {Enum.find(an, &(&1 == x)), Enum.find(bm, &(&1 == x))} do
      {^x, ^x} -> "MrMaxValu"
      {^x, nil} -> "MrMax"
      {nil, ^x} -> "MaxValu"
      _ -> -1
    end
  end
end
0