Monday, August 18, 2014

COJ 1160. Number Steps

Here is the problem statement
http://www.spoj.com/problems/NSTEPS/

This task is full of stuff that need to be noticed. Suppose the give coordinates are X amd Y. First of all notice that the the number exists only when x==y or x==y+2. Then you need to check for one more thing. Notice that if x is an even number the answer is x+y else its x+y-1


       DOWNLOAD THE FULL SOURCE CODE

No comments:

Post a Comment