Tony's Log

Algorithms, Distributed System, Machine Learning

  博客园 :: 首页 :: 新随笔 :: 联系 :: 订阅 :: 管理 ::

随笔分类 -  HackerRank

上一页 1 2 3 4 5 6 7 下一页

摘要:First problem to learn Max Flow. Ford-Fulkerson is a group of algorithms - Dinic is one of it.It is an iterative process: we use BFS to check augament 阅读全文
posted @ 2016-02-17 12:23 Tonix 阅读(375) 评论(0) 推荐(0)

摘要:Intuitive one to learn about Grundy basic :) Now every pile becomes a game, so we need to use Sprague-Grundy Theory. Calculation is quite intuitive - 阅读全文
posted @ 2016-02-11 09:04 Tonix 阅读(312) 评论(0) 推荐(0)

摘要:Please note: VROOK cannot go back-ward - that leads to a simple variation to Game of Nim: just XOR. t = int(input()) for _ in range(t): n = int(input( 阅读全文
posted @ 2016-02-11 05:15 Tonix 阅读(230) 评论(0) 推荐(0)

摘要:A variation to 0-1 Knapsack. (No Python code got fully AC. Python is too slow for this problem) #include <cmath> #include <cstdio> #include <vector> # 阅读全文
posted @ 2016-02-03 14:32 Tonix 阅读(414) 评论(0) 推荐(0)

摘要:This is 'Difficult' - I worked out it within 45mins, and unlocked HackerRank Algorithm Level 80 yeah! So the idea is straight forward: 1. sort the inp 阅读全文
posted @ 2016-01-28 14:16 Tonix 阅读(318) 评论(0) 推荐(0)

摘要:Just for study from its editorial~Lesson learnt: an optimized Hungarian Algorithm: Hopcroft-Karp Algorithm (a batched version of Hungarian)A very good... 阅读全文
posted @ 2016-01-27 14:32 Tonix 阅读(333) 评论(0) 推荐(0)

摘要:A sly knapsack problem in disguise! Thanks tohttps://github.com/bhajunsingh/programming-challanges/tree/master/hackerrank/algorithms/the-indian-jobLes... 阅读全文
posted @ 2015-11-26 08:44 Tonix 阅读(305) 评论(0) 推荐(0)

摘要:I had the same BFS idea as one of the AC code this: because dying pattern is spead from the initial dying ones :)#include #include #include using name... 阅读全文
posted @ 2015-11-26 07:10 Tonix 阅读(1006) 评论(0) 推荐(0)

摘要:Learnt from here:http://www.cnblogs.com/lautsie/p/3798165.htmlIdea is: we union all pure black edges so we get 1+ pure black edge groups. Then we can ... 阅读全文
posted @ 2015-11-26 03:51 Tonix 阅读(245) 评论(0) 推荐(0)

摘要:Actually I think problem statement is somewhat misleading. No need to mention range [L, R] at all.The intention is a variation to "Largest Rectangle" ... 阅读全文
posted @ 2015-11-23 15:49 Tonix 阅读(251) 评论(0) 推荐(0)

摘要:The most interesting, flexible and juicy binary tree problem I have ever seen.I learnt it from here: https://codepair.hackerrank.com/paper/5fIoGg74?b=... 阅读全文
posted @ 2015-11-22 12:51 Tonix 阅读(475) 评论(0) 推荐(0)

摘要:XOR -> 0 is the key (make it even pair): http://www.cnblogs.com/lautsie/p/3908006.htmlSomething to learn about basic Game Theory: http://www.cdf.toron... 阅读全文
posted @ 2015-11-22 11:56 Tonix 阅读(191) 评论(0) 推荐(0)

摘要:A typical game theory problem - Recursion + Memorized Searchhttp://justprogrammng.blogspot.com/2012/06/interviewstreet-challenges-permutation.html#.Vl... 阅读全文
posted @ 2015-11-22 10:34 Tonix 阅读(286) 评论(0) 推荐(0)

摘要:Same as LintCode "Sliding Window Median", but requires more care on details - no trailing zeroes.#include #include #include #include #include #include... 阅读全文
posted @ 2015-11-21 14:38 Tonix 阅读(225) 评论(0) 推荐(0)

摘要:Something to learn: Rotation ops in AVL tree does not require recursion.https://github.com/andreimaximov/hacker-rank/blob/master/data-structures/tree/... 阅读全文
posted @ 2015-11-21 13:42 Tonix 阅读(288) 评论(0) 推荐(0)

摘要:Something to learn:http://blog.csdn.net/yuwenshi/article/details/36666453Shortest Job First Algorithm - kinda greedy: we do shorter job first BUT we o... 阅读全文
posted @ 2015-11-19 07:20 Tonix 阅读(437) 评论(0) 推荐(0)

摘要:Regular Union-Find practice one.#include #include #include #include #include #include #include #include #include using namespace std;unordered_map ps;... 阅读全文
posted @ 2015-11-19 06:02 Tonix 阅读(307) 评论(0) 推荐(0)

摘要:Typical Trie usage. But please note that it could be any order of input strings.#include #include #include #include #include #include #include using n... 阅读全文
posted @ 2015-10-01 01:07 Tonix 阅读(354) 评论(0) 推荐(0)

摘要:It should be categorized as 'Advanced' I think ... Anyway, Fenwick tree is the key.Editorial:https://www.hackerrank.com/challenges/candles-2/editorial... 阅读全文
posted @ 2015-08-10 13:07 Tonix 阅读(666) 评论(0) 推荐(0)

摘要:A trickier Dijkstra.#include #include #include #include #include #include #include #include #include using namespace std;const int INF = std::numeric_... 阅读全文
posted @ 2015-08-03 07:41 Tonix 阅读(399) 评论(0) 推荐(0)

上一页 1 2 3 4 5 6 7 下一页