编程竞赛方式

发布于 2024-12-23 12:14:25 字数 509 浏览 0 评论 0原文

这个问题比较宽泛,但想听听专家的意见。 我发现了一份文档 后缀数组 - 一种竞赛方法,还发现一些评论认为参与者应该准备好手中已有的此类数据结构。如今,许多在线编程难题都带有时间限制。所以我想知道还应该准备哪些其他数据结构/算法。

This is broad question, but would like to know views of experts.
I came across one document Suffix arrays – a contest approach, also found some comments that participant should be ready with such data structures already in hand. now a days lot of online programming puzzles are coming with time bound. So I would like to know what are the other data-structures/algorithms should one be ready with.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

难理解 2024-12-30 12:14:25

我已经参加了大约 10 年的比赛,并且自己创建了一个还不错的库。大多数真正优秀的竞争对手都有他们的博客,例如传奇人物 Petr Mitrichev,他们在那里解释他们得到的想法关于一些竞争问题。阅读这些内容可以对您有所帮助 - 如果您看到一个好主意,请实施它并将其存储起来。
当我看到涉及算法的问题时,我会将算法添加到我的库中。这样我就可以验证我的实现是否正确——只有当我通过了至少一个算法的实现问题时,我才会添加算法。

这是我拥有的一些算法的列表:

  • 我有一个巨大的几何库,其中包含表示点、线、多边形、线段、圆的类以及它们的一些操作(例如交集、点集的凸包等)
  • Tarjan 的 < href="http://en.wikipedia.org/wiki/Tarjan%27s_strongly_connected_components_algorithm" rel="nofollow noreferrer">算法连接组件
  • Dinitz 流算法
  • 二分匹配实现
  • 最小成本最大流实现
  • Aho-Corasic 字符串搜索算法
  • Knuth-morris-pratt 字符串搜索算法
  • Rabin-Karp 字符串搜索算法
  • 使用 ukonnen 的 算法
  • 快速求
  • 幂 多项式实现
  • 大整数实现
  • 小数实现
  • 矩阵类实现
  • 质因数分解
  • Eratosthenes 筛
  • 线段树
  • 匈牙利算法
  • 2-Sat 算法。为此,我使用上面提到的 Tarjan 算法。

你会注意到一些最基本的算法(如 BFS、DFS、Dijkstra)上面没有提到,那是因为我没有实现它们。这些算法不能简单地以简单地复制和粘贴它们并且一切都会起作用的方式进行概括。而且我只花了不到 5 分钟的时间来编写它们 - 我通常只在我的库中放入难以实现或在实现时容易出错的算法。

I have been competing for about 10 years now and have created a not-so-bad library myself. Most of the really good competitors have their blogs for instance the legend Petr Mitrichev and there they explain ideas they got on some competitive problems. Reading these can help you - if you see a nice idea implement it and have it stored.
I add algorithms to my library when I see a problem that involves them. That way I can verify that my implementation is correct- I only add an algorithm if I have passed at least one problem with its implementation.

Here is a list with some of the algorithms I have:

  • I have a huge geometrial library with classes representing points, lines, polygons, segments, circles and some operations with them(for instance intersection, convex hull of set of points etc)
  • Tarjan's algorithm for strongly connected components
  • Dinitz flow algorithm
  • Bipartite matching implementation
  • Min cost max flow implementation
  • Aho-Corasic string searching algorithm
  • Knuth-morris-pratt string searching algorithm
  • Rabin-Karp string searching algorithm
  • Linear time suffix tree using ukonnen's algorithm
  • Fast exponentiation
  • Polynom implementation
  • Big integer implementation
  • Fractional numbers implementation
  • Matrix class implementation
  • Prime factorization
  • Eratosthenes Sieve
  • Segment Tree
  • Hungarian algorithm
  • 2-Sat algorithm. For this I use Tarjan's algorithm mentioned above.

You will notice that some of the most basic algorithms(like BFS,DFS, Dijkstra) are not mentioned above and that is because I don't have them implemented. These algorithms can not be easily generalized in a way that you will simply copy and paste them and everything will work. Also it takes me less then 5 minutes to write them - I usually put in my library only algorithms that are either hard to implement or are easy to make an error when implementing them.

番薯 2024-12-30 12:14:25

查看这些专题文章 @ TopCoder。他们真的很酷。

当您参与其中时,我建议您参加 TopCoder 的编程竞赛。因为提高的最好方法就是练习和练习。继续参加此类比赛。

此外,Project Euler 也确实令人上瘾。

Check out these featured articles @ TopCoder. They are really cool.

While you are at it, I suggest taking part in the programming contests at TopCoder. Because the best way to improve is to practice & keep taking part in such contests.

Also Project Euler too is really addictive.

装迷糊 2024-12-30 12:14:25

另外,请查看编程挑战一书,它是关于主题 - 它提供了在编程竞赛中取得成功所需的主题,并由 在线判断。

Also, take a look at the Programming Challenges book, it's a great reference on the subject - it presents the topics necessary for succeeding in a programming contest, backed by an online judge.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文