結果
| 問題 |
No.1527 Input Constant is Good
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-07-22 15:39:01 |
| 言語 | Elixir (1.18.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 194 bytes |
| コンパイル時間 | 869 ms |
| コンパイル使用メモリ | 63,272 KB |
| 実行使用メモリ | 119,088 KB |
| 最終ジャッジ日時 | 2024-07-17 14:54:36 |
| 合計ジャッジ時間 | 8,198 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / 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.puts "Yes", else: IO.puts "No";
│ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
│
└─ Main.exs:4
ソースコード
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.puts "Yes", else: IO.puts "No";
end
end