摘要:
转载请注明出处:http://www.cnblogs.com/ligun123/archive/2013/04/01/2993966.htmlThere is an integer arraydwhich does not contain more than two elements of the same value. How many distinct ascending triples (d[i] < d[j] < d[k], i < j < k) are present?Input formatThe first line contains an integer 阅读全文
摘要:
转载注明出处:http://www.cnblogs.com/ligun123/archive/2013/03/27/2984740.html题目来源:https://www.hackerrank.com/challenges/medianThe median of M numbers is defined as the middle number after sorting them in order if M is odd or the average number of the middle 2 numbers (again after sorting) if M is even. You 阅读全文
摘要:
转载注明出处:http://www.cnblogs.com/ligun123/archive/2013/03/26/2982472.html题目来源:https://www.hackerrank.com/challenges/flowersYou and your K-1 friends want to buy N flowers. Flower number i has cost ci. Unfortunately the seller does not like a customer to buy a lot of flowers, so he tries to change the pr 阅读全文
摘要:
转载注明出处 http://www.cnblogs.com/ligun123/archive/2013/03/19/2969477.html题目来源:https://www.hackerrank.com/challenges/billboardsBillboardsADZEN is a very popular advertising firm in your city. In every road you can see their advertising billboards. Recently they are facing a serious challenge , MG Road t 阅读全文
摘要:
转载注明出处 http://www.cnblogs.com/ligun123/archive/2013/03/19/2969438.html先是跟着Hackerrank练习了下插入排序然后又做了Pairs,来源:https://www.hackerrank.com/challenges/pairsGiven N numbers [N<=10^5], count the total pairs of numbers that have a difference of K. [K>0 and K<1e9]. Each of the N numbers will be > 0 阅读全文