結果
| 問題 | No.531 エヌスクミ島の平和協定 |
| コンテスト | |
| ユーザー |
nonokai10
|
| 提出日時 | 2018-03-12 13:50:09 |
| 言語 | Ruby (4.0.2) |
| 結果 |
AC
|
| 実行時間 | 54 ms / 2,000 ms |
| コード長 | 171 bytes |
| 記録 | |
| コンパイル時間 | 334 ms |
| コンパイル使用メモリ | 9,216 KB |
| 実行使用メモリ | 14,976 KB |
| 最終ジャッジ日時 | 2026-04-08 06:25:11 |
| 合計ジャッジ時間 | 3,638 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 37 |
コンパイルメッセージ
Main.rb:4: warning: ambiguous first argument; put parentheses or a space even after `-` operator Main.rb:10: warning: ambiguous first argument; put parentheses or a space even after `-` operator Syntax OK
ソースコード
n, m = gets.split.map(&:to_i)
if n.odd?
if n > m
p -1
else
p 1
end
else
if n / 2 > m
p -1
elsif n / 2 <= m && n > m
p 2
else
p 1
end
end
nonokai10