結果
| 問題 |
No.1527 Input Constant is Good
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-07-22 15:38:43 |
| 言語 | Elixir (1.18.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 193 bytes |
| コンパイル時間 | 2,091 ms |
| コンパイル使用メモリ | 62,752 KB |
| 実行使用メモリ | 55,360 KB |
| 最終ジャッジ日時 | 2024-07-17 14:54:27 |
| 合計ジャッジ時間 | 8,171 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 1 RE * 1 |
| other | WA * 4 RE * 5 |
コンパイルメッセージ
warning: missing parentheses for expression following "do:" keyword. Parentheses are required to solve ambiguity inside keywords.
This error happens when you have function calls without parentheses inside keywords. For example:
function(arg, one: nested_call a, b, c)
function(arg, one: if expr, do: :this, else: :that)
In the examples above, we don't know if the arguments "b" and "c" apply to the function "function" or "nested_call". Or if the keywords "do" and "else" apply to the function "function" or "if". You can solve this by explicitly adding parentheses:
function(arg, one: if(expr, do: :this, else: :that))
function(arg, one: nested_call(a, b, c))
Ambiguity found at:
│
4 │ if a <= b, do: IO.put "Yes", else: IO.puts "No";
│ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
│
└─ Main.exs:4
warning: IO.put/2 is undefined or private. Did you mean:
* puts/1
* puts/2
│
4 │ if a <= b, do: IO.put "Yes", else: IO.puts "No";
│ ~
│
└─ Main.exs:4:23: Main.main/0
ソースコード
defmodule Main do
def main do
[a, b] = IO.read(:line) |> String.trim |> String.split(" ") |> Enum.map(&String.to_integer/1)
if a <= b, do: IO.put "Yes", else: IO.puts "No";
end
end