如何在这种形状中找到真正的方法? [英] How to find true ways in this shape?

查看:70
本文介绍了如何在这种形状中找到真正的方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好

我们有一个正方形的大小:n * n

我们想选择真正的方式:

真正的方式是方式从大广场的左下方到大广场的右上方。这些方式也不能跨越大方块的图表。

例如:



http://i59.tinypic.com/2wqfofp.pngborder =0alt =图片和视频托管由TinyPic



我们有2 * 2平方。

真实方式:(右 - 右 - 顶 - 顶)和(右 - 上 - 右 - 上)

应用程序应选择并显示用户的真实方式。

请帮帮我。

谢谢。

Hello
we have a square in size : n*n
we want to select the true ways :
True Ways are ways that are from left-down of the big square to top-right of big square.and also these ways can not across of the big square`s diagram.
for example :

http://i59.tinypic.com/2wqfofp.png" border="0" alt="Image and video hosting by TinyPic

we have 2*2 square.
True ways : (right - right - top - top) and (right - top - right - top)
The application should select and show the true ways for user.
Please help me.
Thank you.

推荐答案

我不认为它有一个简单的算法...

理查德没有说一个简单的算法。他说算法。

你需要弄清楚如何去做,因为你可以开始编码了!



所以从一开始纸和笔:为您提供简单的示例,如何手动到达,制定规则,然后尝试在纸上实现它们。优化规则,直到每次都可以执行。然后,您可以查看更复杂的示例,并手动应用规则。如果你的系统有效,你可以开始实现它 - 但这可能很容易! :笑:



我们不打算为你完成这一切:这是你的功课,而不是我们的功课!如果你遇到困难,那么我们很乐意提供帮助 - 但你需要付出一些努力并首先尝试自己做。
"I do not think it has an easy algorithm ..."
Richard didn't say "an easy algorithm". He said "an algorithm".
You need to work out how to do it befor you can start coding it!

So start with paper and pencil: work out for you simple example how you get there manually, work out the rules, and then try to implement them on paper. Refine the rules until you can do it every time. Then you can look at a more complex example, and apply your rules manually. When you have a system that works, you can start to implement it - but that's probably the easy bit! :laugh:

We aren't going to do the whole of that for you: it's your homework, not ours! If you get stuck on a particular bit, then we will be happy to help - but you need to put some effort in and try and do it yourself first.


这篇关于如何在这种形状中找到真正的方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆