Logic 能够解决谷歌代码阻塞问题集

Logic 能够解决谷歌代码阻塞问题集,logic,Logic,这不是一个家庭作业问题,而是我想知道这是否是学习编程的必要条件。我一直登录TopCoder,不是为了实际参与,而是为了基本了解问题是如何解决的。但据我所知,我不明白问题是什么,以及如何将问题转化为能够解决问题的算法。 刚才我碰巧看到了正在中国举行的ACM ICPC 2010世界总决赛。向各小组提供了问题集,其中一个是: Given at most 100 points on a plan with distinct x-coordinates, find the shortest cycl

这不是一个家庭作业问题,而是我想知道这是否是学习编程的必要条件。我一直登录TopCoder,不是为了实际参与,而是为了基本了解问题是如何解决的。但据我所知,我不明白问题是什么,以及如何将问题转化为能够解决问题的算法。 刚才我碰巧看到了正在中国举行的ACM ICPC 2010世界总决赛。向各小组提供了问题集,其中一个是:

Given at most 100 points on a plan with distinct x-coordinates,
   find the shortest cycle that passes through each point exactly once, 
   goes from the leftmost point always to the right until it reaches the 
   rightmost point, then goes always to the left until it gets back to the 
   leftmost point. Additionally, two points are given such that the the path
   from left to right contains the first point, and the path from right to 
   left contains the second point. This seems to be a very simple DP: after 
   processing the last k points, and with the first path ending in point a 
   and the second path ending in point b, what is the smallest total length
   to achieve that? This is O(n^2) states, transitions in O(n). We deal 
   with the two special points by forcing the first path to contain the first 
   one, and the second path contain the second one.
现在我不知道看完习题后我应该解决什么问题

还有一个来自google code jam的:

    Problem

        In a big, square room there are two point light sources: 
one is red and the other is green. There are also n circular pillars.

        Light travels in straight lines and is absorbed by walls and pillars. 
    The pillars therefore cast shadows: they do not let light through. 
    There are places in the room where no light reaches (black), where only 
    one of the two light sources reaches (red or green), and places where 
    both lights reach (yellow). Compute the total area of each of the four
     colors in the room. Do not include the area of the pillars.

        Input

            * One line containing the number of test cases, T.

        Each test case contains, in order:

            * One line containing the coordinates x, y of the red light source.
            * One line containing the coordinates x, y of the green light source.
            * One line containing the number of pillars n.
            * n lines describing the pillars. Each contains 3 numbers x, y, r. 
    The pillar is a disk with the center (x, y) and radius r.

        The room is the square described by 0 ≤ x, y ≤ 100. Pillars, room 
    walls and light sources are all disjoint, they do not overlap or touch. 

Output

For each test case, output:

Case #X:
black area
red area
green area
yellow area
是否要求编程人员能够解决此类问题

我想知道是否有人能帮我解释谷歌代码堵塞问题集,因为我希望参加今年的
code堵塞
,看看我能不能做点什么


谢谢。

你应该从更简单的问题开始。试着寻找地区,甚至从当地学校的比赛中找出问题。
从数据结构到算法,您需要对一般编程有一个全面的了解。掌握一门基本的编程语言,答案是可以接受的。

你不能通过比赛开始学习编程。如果你根本不懂任何编程,那么你首先要编写的程序就是“hello world”,fibonacci和ackermann。从TopCoder开始就像学习使用一级方程式赛车驾驶一样。这样不行。

你说得很对,杰斯佩尔。JPRO,回到最基本的问题上来,从那里解决问题。您的竞争能力和赢得编程竞赛的能力取决于两件事:

  • 您对所用语言的深刻理解以及
  • 你对语言的心理灵活性

  • 简言之,您必须了解用于开发此类问题的一些基本技术。了解动态规划、回溯算法、搜索等,对解决问题有很大帮助


    这个来自Google Code Jam的代码实际上相当难,并且涉及到计算几何算法。这里详细介绍了如何解决这个问题:

    从难题开始是一个很大的错误。很多世界总决赛的问题对于很多有经验的程序员来说都太难了,所以对于新手来说也太难也就不足为奇了

    正如其他人所说,从更容易的问题开始。我假设您了解编程的基础知识,并且能够用至少一种编程语言编写代码。尝试TopCoder上第2部分问题集的问题,以及ACM ICPC的区域/资格赛。从SPOJ、UVa和Project Euler等网站上找出容易的问题(网上有容易的问题列表)并解决它们。当你解决问题时,也要阅读算法和计算机科学的基础知识。TopCoder是一个很好的资源,因为他们有很多教程和文章,还允许您查看其他人的解决方案


    总之,成为一名更好的程序员需要大量的实践和研究。没有捷径可走。你不能假设你是一个英雄程序员,可以直接跳进去解决所有问题。你只需要接受还有很长的路要走,从一开始就开始。

    在过去一周左右的时间里,我一直在研究谷歌代码阻塞问题,我认为这些问题是很好的练习。关键是要找到一些问题,这些问题会让你的能力有所提升,但不是那些让你想放弃的问题。谷歌代码堵塞问题难度很大

    我建议从“我应该从哪里开始”下面的内容开始:

    然后探索所有竞赛第一轮的问题。如果这些太容易了,就转到其他回合


    我真正喜欢代码阻塞的地方是,你可以使用几乎任何你想要的语言,你可以从他们的自动判断中得到反馈。如果没有代码阻塞问题,请查看其他人提到的一些网站。

    阅读Larson的《通过问题解决问题》。
    它是用于数学的,但我发现它对解决算法问题非常有用。

    更简单的问题,如?这个问题集是代码JAM中的第一个问题。这里有一个简单的(r)问题,将阿拉伯数字转换成罗马数字,例如:2010年X中的10,转换成MMX,然后将这个反罗马到阿拉伯的XLIX写到49@Pentium10这是一篇老文章,但我的问题有点类似于OP,我可以理解这个问题,但我不知道从哪里/如何开始解决它。那么,一般来说,我关注的是什么?我是否像NLP一样缺少专业知识?机器学习?或者某种CS理论(我不是大学毕业生),或者这只是简单的算法设计和数学?学习编译器设计之类的具体知识会有帮助吗?@gideon No,这属于竞争性编程,通常问题包括算法、数据结构、数论、几何、高级数据结构问题。+1项目euler非常有助于快速入门此类数学/算法问题。