level 11
🍭Canon
楼主
be wary of roses
You've always been proud of your prize rose garden. However, some jealous fellow gardeners will stop at nothing to gain an edge over you. They have kidnapped, blindfolded, and handcuffed you, and dumped you right in the middle of your treasured roses! You need to get out, but you're not sure you can do it without trampling any precious flowers.
Fortunately, you have the layout of your garden committed to memory. It is an N×Ncollection of square plots (N odd), some containing roses. You are standing on a square marble plinth in the exact center. Unfortunately, you are quite disoriented, and have no idea which direction you're facing! Thanks to the plinth, you can orient yourself facing one of North, East, South, or West, but you have no way to know which.
You must come up with an escape path that tramples the fewest possible roses, no matter which direction you're initially facing. Your path must start in the center, consist only of horizontal and vertical moves, and end by leaving the grid.
原题大概是这样的
你被困在一个花园里面,你不知道你正在朝向的方位,但是你能够向前走、向右走、向后走或者向左走。而且花园里面有些地方会有鲜花,你是一个热爱花朵的人,你不希望践踏花朵,但是为了逃出去,可能不得踩死一些,现在就要你找出一个行走的方案。(即向前->向后。。。。)这个方案能让你践踏尽量少的的花并逃出去。
求大神帮忙
2015年08月21日 09点08分
1
You've always been proud of your prize rose garden. However, some jealous fellow gardeners will stop at nothing to gain an edge over you. They have kidnapped, blindfolded, and handcuffed you, and dumped you right in the middle of your treasured roses! You need to get out, but you're not sure you can do it without trampling any precious flowers.
Fortunately, you have the layout of your garden committed to memory. It is an N×Ncollection of square plots (N odd), some containing roses. You are standing on a square marble plinth in the exact center. Unfortunately, you are quite disoriented, and have no idea which direction you're facing! Thanks to the plinth, you can orient yourself facing one of North, East, South, or West, but you have no way to know which.
You must come up with an escape path that tramples the fewest possible roses, no matter which direction you're initially facing. Your path must start in the center, consist only of horizontal and vertical moves, and end by leaving the grid.
原题大概是这样的
你被困在一个花园里面,你不知道你正在朝向的方位,但是你能够向前走、向右走、向后走或者向左走。而且花园里面有些地方会有鲜花,你是一个热爱花朵的人,你不希望践踏花朵,但是为了逃出去,可能不得踩死一些,现在就要你找出一个行走的方案。(即向前->向后。。。。)这个方案能让你践踏尽量少的的花并逃出去。
求大神帮忙