SSTORY - Editorial
PROBLEM LINK:PracticeContestAuthor:Bruno OliveiraTester:Mahbubul HasanEditorialist:Jingbo ShangDIFFICULTY:MediumPREREQUISITES:Suffix Array, Suffix Automaton, Binary Search, HashPROBLEM:Find the longest...
View ArticleFinding minimum operations
Given a number N (1<= N <= 10^9) Find minimum number of operations to reduce N to 1. The allowed operations being Division by 2Division by 3Subtracting 1All intermediate values of N should also...
View ArticleMAXCOUNT - Editorial
PROBLEM LINKSPracticeContestDIFFICULTYEASYEXPLANATIONThis was supposed to be a problem that anyone who knows basic programming could solve and I'm glad that it's satisfied our expectations.For the...
View ArticleMIKE3 - Editorial
PROBLEM LINK:PracticeContestAuthor:Constantine SokolTester:Mahbubul HasanEditorialist:Jingbo ShangDIFFICULTY:EasyPREREQUISITES:SearchPROBLEM:Given N objects and M weighted subsets of them, find a...
View ArticleABC-String
Dear all , I am getting WA for the below solution .While local testing , I am getting correct Answer .Any pointer will help me to understand the issue in below implementationThanks rajesh ############...
View ArticleTLE using bitmasks.... :(
Why does using a O(2^N * N) approach for this question give TLE.... Solution :- http://www.codechef.com/viewsolution/3652333
View ArticleCheck if a number is multiple of 9 using bitwise operators
Hi all.In this article (link : http://www.geeksforgeeks.org/divisibility-9-using-bitwise-operators/ ) it is written that (n%8) is equal to (int)(n&7) ( in the function bool isDivBy9(int n) ).Can...
View Articletime difference in two same solution
i submitted my solution for the problem Please like me in jan2014 long challenge. my first solution got time limit exceeded than i created one more solution and in that solution i just added function...
View ArticleShortest Path in a Graph visiting all nodes atleast once!
I have been trying to solve following problem from topcoder practice problems:Problem LinkI have found one of topcoder user's solution, but I could not understand it. Can somebody please explain me the...
View ArticleIndiaHacks on HackerEarth
HackerEarth kicks off this summer with India's largest online programming contest - IndiaHacks 2014. We invite all top hackers to a 24 hour programming contest with 7 challenging problems. The...
View ArticleDifference between qsort() and sort() ?
I tried solving the question HORSES < http://www.codechef.com/problems/HORSES> , according to my algorithm, I had to sort the array and compare the adjacent entries for minimum difference. My...
View ArticleTaking Appropriate number of test cases from input buffer
I am having problem in solving a part of problem. In this problem, we are given an input buffer and we have to take appropriate number of test cases of inputs from it. For example, the input can be 3 4...
View ArticleAPC 2014 - Interesting powers of two
Can anyone tell how to solve this question from APC 2014 interesting powers of two
View Article2nd largest element of a max-heap
Hai i have just started learning Data Structures.Please help me...Suppose i have a max heap of arr[1....n].arr[1] stores the maximum element. Is there any way in which i can find the second largest...
View ArticleGOC2014 - DMS Mathematica Explain the solution?
The answer seems to be (n*n)/2 - 1 .For N =5 , ans = 11 ;But I think it should be 10; permutation 5 1 4 2 3 4 + 3 + 2 + 1 = 10If I am wrong please explain ?
View ArticleA tutorial on Fast Modulo Multiplication (Exponential Squaring)
Hello @all,This tutorial will cover the topic of Fast Modulo Multiplication (also known as Exponential Squaring or Repeated Squaring).This is a very useful technique to have under your arsenal as a...
View ArticleMATCHSTICK WA
Hey guys was trying to solve http://www.codechef.com/problems/MSTICK/ by using segment trees but everytime WA comes up ...heres my code http://www.codechef.com/viewsolution/3653425 please help..:(
View Articleprograms for integer to roman number.
I want to know what is the roman number of 49 is it XLIX or IL.I participated in computer's fest they gave me program to convert integer to romans .I solved ,but they are saying roman number will be...
View ArticleHow to create a randomized algorithm function
I am creating a reaction game using a series of lasers and LRDs and need to make a function which waits for a specific pin in portb to be triggered high before it can move onto waiting for the next pin...
View ArticleGOC14 Explanation regarding BALL ROOM ?
I didn't quite get what the question was asking.Also the accepted solutions all looked kinda same.Can anyone please explain what the question was asking and how to approach these types of problems?
View Article