上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 37 下一页

2014年8月31日

CodeChef August Lunchtime 2014 题解

摘要: A题给一个由a和b两种类型的字符组成的字符串,每次可以从中选取任意长度的回文子序列(不一定连续)并删除。问最少需要几次能将整个字符串为空。思路:如果本身是个回文串,那么只需要一次,否则需要两次(第一次选全部的a,第二次全部选b)。Accepted Code: 1 def is_palidrome(s... 阅读全文

posted @ 2014-08-31 21:38 Stomach_ache 阅读(218) 评论(0) 推荐(0) 编辑

Hackerrank--Team Formation

摘要: 题目链接For an upcoming programming contest, Roy is forming some teams from thenstudents of his university. A team can have any number of contestants.Roy ... 阅读全文

posted @ 2014-08-31 12:29 Stomach_ache 阅读(1032) 评论(0) 推荐(0) 编辑

2014年8月27日

Hackerrank--XOR love (Math系列)

摘要: 题目链接Devendra loves the XOR operation very much which is denoted by∧sign in most of the programming languages. He has a listAofNnumbers and he wants to... 阅读全文

posted @ 2014-08-27 21:16 Stomach_ache 阅读(313) 评论(0) 推荐(0) 编辑

Hackerrank--Lexicographic paths

摘要: 题目链接Krishnakant is standing at(0,0)in the Cartesian plane. He wants to go to the point(N,M)in the same plane using only horizontal and vertical moves ... 阅读全文

posted @ 2014-08-27 13:30 Stomach_ache 阅读(415) 评论(0) 推荐(0) 编辑

2014年8月26日

Hdu 1384(差分约束)

摘要: 题目链接IntervalsTime Limit: 10000/5000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2931Accepted Submission(s): 1067Prob... 阅读全文

posted @ 2014-08-26 11:07 Stomach_ache 阅读(252) 评论(0) 推荐(0) 编辑

2014年8月25日

Hackerrank--Volleyball Match

摘要: 题目链接Tatyana is a big sports fan and she likes volleyball a lot! She writes down the final scores of the game after it has ended in her notebook.If you... 阅读全文

posted @ 2014-08-25 18:53 Stomach_ache 阅读(659) 评论(0) 推荐(0) 编辑

Hackerrank--Prime Sum

摘要: 题目链接The problem is quite simple. You're given a number N and a positive integer K. Tell if N can be represented as a sum of K prime numbers (not neces... 阅读全文

posted @ 2014-08-25 12:44 Stomach_ache 阅读(392) 评论(0) 推荐(0) 编辑

2014年8月24日

Hackerrank--Savita And Friends(最小直径生成树MDST)

摘要: 题目链接After completing her final semester, Savita is back home. She is excited to meet all her friends. HerNfriends live in different houses spread acro... 阅读全文

posted @ 2014-08-24 10:20 Stomach_ache 阅读(363) 评论(0) 推荐(0) 编辑

2014年8月23日

Hackerrank--Kundu and Tree

摘要: 题目链接Kundu is true tree lover. Tree is a connected graph havingNvertices andN-1edges. Today when he got a tree, he colored each edge with one of either... 阅读全文

posted @ 2014-08-23 22:26 Stomach_ache 阅读(677) 评论(0) 推荐(0) 编辑

2014年8月22日

Hackerrank--String Function Calculation(后缀数组)

摘要: 题目链接Jane loves string more than anything. She made a function related to the string some days ago and forgot about it. She is now confused about calcu... 阅读全文

posted @ 2014-08-22 18:55 Stomach_ache 阅读(1037) 评论(0) 推荐(1) 编辑

上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 37 下一页

导航