結果
| 問題 | No.531 エヌスクミ島の平和協定 |
| コンテスト | |
| ユーザー |
wonda_t_coffee
|
| 提出日時 | 2020-02-04 22:53:19 |
| 言語 | Ruby (4.0.2) |
| 結果 |
AC
|
| 実行時間 | 54 ms / 2,000 ms |
| コード長 | 127 bytes |
| 記録 | |
| コンパイル時間 | 45 ms |
| コンパイル使用メモリ | 9,088 KB |
| 実行使用メモリ | 14,976 KB |
| 最終ジャッジ日時 | 2026-04-09 14:42:52 |
| 合計ジャッジ時間 | 3,399 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 37 |
コンパイルメッセージ
Main.rb:6: 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.chomp.split.map(&:to_i) if n <= m puts 1 elsif n % 2 == 1 puts -1 elsif n / 2 <= m puts 2 else puts -1 end
wonda_t_coffee