結果

問題 No.8032 Unavailability of Inequality Signs
コンテスト
ユーザー norioc
提出日時 2024-07-24 02:31:09
言語 Elixir
(1.20.3)
コンパイル:
elixirc _filename_
実行:
elixir -e Main.main
結果
RE  
実行時間 -
コード長 498 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 568 ms
コンパイル使用メモリ 77,108 KB
実行使用メモリ 66,536 KB
最終ジャッジ日時 2026-08-24 09:13:28
合計ジャッジ時間 6,128 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 RE * 2
other AC * 1 RE * 6
権限があれば一括ダウンロードができます
コンパイルメッセージ
    warning: the following conditional expression:

        [45 | _] = String.to_charlist(Integer.to_string(a - b))

    will always evaluate to:

        dynamic(non_empty_list(term(), term()))

    where "a" was given the type:

        # type: integer()
        # from: Main.exs:13:61
        a - b

    where "b" was given the type:

        # type: integer()
        # from: Main.exs:13:61
        a - b

    type warning found at:
    │
 13 │         if [?- | _] = String.to_charlist(Integer.to_string(a-b)) do
    │         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    │
    └─ Main.exs:13: Main.f/1

ソースコード

diff #
raw source code

defmodule Main do
  def main do
    n = ii()
    f(n)
  end

  def f(n) do
    if n != 0 do
      [a, b] = li()
      if a == b do
        IO.puts("=")
      else
        if [?- | _] = String.to_charlist(Integer.to_string(a-b)) do
          IO.puts [60]
        else
          IO.puts [62]
        end
      end
      f(n-1)
    end
  end

  def input, do: String.trim(IO.read(:line))
  def ii, do: String.to_integer(input())
  def li, do: Enum.map(String.split(input()), &String.to_integer/1)
end
0