結果
| 問題 |
No.240 ナイト散歩
|
| ユーザー |
zazaboon
|
| 提出日時 | 2017-05-23 17:23:07 |
| 言語 | Ruby (3.4.1) |
| 結果 |
AC
|
| 実行時間 | 94 ms / 2,000 ms |
| コード長 | 318 bytes |
| コンパイル時間 | 384 ms |
| コンパイル使用メモリ | 7,296 KB |
| 実行使用メモリ | 12,288 KB |
| 最終ジャッジ日時 | 2024-10-07 21:39:14 |
| 合計ジャッジ時間 | 4,080 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 30 |
コンパイルメッセージ
Syntax OK
ソースコード
# Here your code !
def ser(x,y,d)
return if(d==4)
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