結果
| 問題 |
No.240 ナイト散歩
|
| コンテスト | |
| ユーザー |
zazaboon
|
| 提出日時 | 2017-05-23 17:20:18 |
| 言語 | Ruby (3.4.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 299 bytes |
| コンパイル時間 | 180 ms |
| コンパイル使用メモリ | 7,552 KB |
| 実行使用メモリ | 12,416 KB |
| 最終ジャッジ日時 | 2024-09-19 11:42:10 |
| 合計ジャッジ時間 | 4,149 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 WA * 1 |
| other | AC * 24 WA * 6 |
コンパイルメッセージ
Syntax OK
ソースコード
def ser(x,y,d)
return if(d==3)
if(x == @x and y == @y)
puts "YES"
exit
end
ser(x-2,y-1,d+1)
ser(x-2,y+1,d+1)
ser(x-1,y-2,d+1)
ser(x-1,y+2,d+1)
ser(x+1,y-2,d+1)
ser(x+1,y+2,d+1)
ser(x+2,y-1,d+1)
ser(x+2,y+1,d+1)
end
@x,@y=gets.chomp.split.map &:to_i
ser(0,0,0)
puts "NO"
zazaboon