随笔分类 -  HackerRank

Touching segments(数据结构)
摘要:题目链接Problem StatementYour Maths professor is a very nice guy, but he sometimes comes up with not so funny tasks. Today is one such day. The professor ... 阅读全文

posted @ 2015-04-14 20:25 Stomach_ache 阅读(331) 评论(0) 推荐(0)

Joining Byte Blocks(哈希+带花树)
摘要:题目链接Problem StatementAs you are probably aware, the Internet protocols specify a canonical byte order convention for data transmitted over the network... 阅读全文

posted @ 2015-04-14 20:23 Stomach_ache 阅读(211) 评论(0) 推荐(0)

Make the Most (Hackerrank Codeagon)
摘要:题目链接Problem StatementCodenationis sendingNof its employees to a High Profile Business Conference and the goal is to cover maximum number of presentati... 阅读全文

posted @ 2015-01-25 15:42 Stomach_ache 阅读(299) 评论(0) 推荐(0)

Schedule(Hackerrank Quora Haqathon)
摘要:题目链接Problem StatementAt Quora, we run all our unit tests across many machines in a test cluster on every code push.One day, we decided to see if we co... 阅读全文

posted @ 2015-01-20 19:39 Stomach_ache 阅读(246) 评论(0) 推荐(0)

树上某点距离最远的结点
摘要:题目链接题目需要得到树上每个结点出发可到达的最远的结点,顺便求出树的直径。这里顺便总结一下求解的两种方法。第一种思路:三种dfs(bfs) 第一遍dfs(bfs)从任意结点出发,找到距离该结点最远的结点u(直径的端点之一)。 第二遍dfs(bfs)从u出发,求出其他点到u的距离,最长的即为v(直... 阅读全文

posted @ 2014-12-01 20:24 Stomach_ache 阅读(843) 评论(0) 推荐(0)

101 Hack October'14
摘要:拖了近一个月的总结。(可能源于最近不太想做事:()A题给出n个长度都为n的字符串,你只可以对每个字符串分别排序,问当每个字符串按升序排序之后,每一列是否也是升序的。 1 #include 2 #include 3 #include 4 #include 5 #include 6 using... 阅读全文

posted @ 2014-11-16 20:41 Stomach_ache 阅读(205) 评论(0) 推荐(0)

Ad Infinitum 8 - Math Programming Contest
摘要:比赛链接A题如果当前数是1,那么后面无论是几都会加1或者当后面数是1的时候加2,所以记录一下后面的数中1的个数(加2)即可。如果当前数是2,那么只有当后面的数为1或者为2时才可以加1,所以再记录一下后面数中2的个数即可。 1 #include 2 #include 3 #include 4 #... 阅读全文

posted @ 2014-10-20 16:25 Stomach_ache 阅读(164) 评论(0) 推荐(0)

Weekly Challenges - Week 11
摘要:一拖再拖,忍无可忍,自己懒的没救了。一周前就结束的比赛,到现在才想起来补。最后一题貌似又遇到了splay。。。还是不会!!!shit题目链接A题--快速幂 1 #include 2 #include 3 #include 4 #include 5 #include 6 using name... 阅读全文

posted @ 2014-10-17 19:27 Stomach_ache 阅读(243) 评论(0) 推荐(0)

Weekly 10 小结
摘要:A题模拟 1 T = int(input()) 2 while T: 3 T -= 1 4 s = raw_input() 5 n = len(s) 6 res, pre = 0, 0 7 for i in xrange(1, n): 8 if... 阅读全文

posted @ 2014-09-17 14:19 Stomach_ache 阅读(201) 评论(0) 推荐(0)

Hackerrank--Mixing proteins(Math)
摘要:题目链接Some scientists are working on protein recombination, and during their research, they have found a remarkable fact: there are 4 proteins in the pr... 阅读全文

posted @ 2014-09-02 18:46 Stomach_ache 阅读(274) 评论(0) 推荐(0)

导航