結果
| 問題 |
No.602 隠されていたゲーム2
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-12-02 01:22:02 |
| 言語 | Ruby (3.4.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 199 bytes |
| コンパイル時間 | 84 ms |
| コンパイル使用メモリ | 7,296 KB |
| 実行使用メモリ | 19,328 KB |
| 最終ジャッジ日時 | 2024-11-28 02:03:50 |
| 合計ジャッジ時間 | 3,447 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 15 WA * 6 |
コンパイルメッセージ
Main.rb:11: warning: ambiguous first argument; put parentheses or a space even after `-' operator Main.rb:1: warning: assigned but unused variable - n Syntax OK
ソースコード
n = gets.to_i
d = gets.split.map(&:to_i)
x, y = gets.split.map(&:to_i)
if x == 0 && y == 0
p 0
elsif d.include?(x.abs + y.abs)
p 1
elsif d.max * 2 >= (x.abs + y.abs)
p 2
else
p -1
end