26th October, 2010, my last day of stay in Siliguri(My home town) in the durga puja vacations. This was the second consecutive instance when there was a SRM on the same evening when I was to board a train. Fortunately both time my train was late (courtsey to Indian railways :P) and I was able to compete.
After my good performance in the last SRM I was again back to div-1. The first problem was of 300 points so it was harder than normal level 1 problem. It took me 30 mins to code I tried my best to think of all the cases.
The Question is as follows :-
Given two integer values start and terminate, you are required to perform certain operations on the start value. The operations were simple "*, +, /, -". You need to take the start value as the two operands and also store the result in the start value. If start=5, and you perform a "*" operation, then start=start*start, start becomes 25. You need to perform minimum number of operations to reach the terminating value, and concatenate the operators. If the minimum number of operations is same then return the lexicographically first string.
I thought and first thing that came in my mind was BFS. I coded a nice BFS solution, and then I thought that using the divide operation we can make the start value 1 and then we could reach the terminating value. So i applied BFS twice with the given start value and start value as 1. Everything seemed fine. I hoped it to pass the system test.
I had missed one critical thing, I was returning the answer if there was any with the given start value, but the answer with start value as 1 and "/" operation added to the beginning could be the answer with less number of operations. This cost me a couple of rating points, and my hope of entering top 100 in India :( :(. Its always better luck next time. I am still in div-1 :)
Thursday, October 28, 2010
Saturday, August 28, 2010
My First Blog Post
I waited long for my first post, here it comes. It has to be about my passion "CODING".
I always liked programming back from my school days, but never got a platform where I could develope my coding skills, until I came to NIT Dgp.
I came to know about two platforms where I could develope my coding skills, http://topcoder.com and http://spoj.pl . The first year passed by without me being much involved in programming, apart from participating in junior codecracker organised by Linux Users' Group of my college.
In the winter break I took programming seriously and started participating in Topcoder. Initially in the SRMs I did not perform well, many a times I cracked the logic but due to some bug in my code it failed the system tests. It was a very slow start.
I participated in 15 SRMs in Topcoder and made my journey from grey to green. Then it was the 16th SRM in which I gave my best performance I was ranked 28th overall in div-2 and advanced to div-1. So the journey was from grey to green to blue. It feels good to be blue for the first time and be in div-1.
Theres a long and tough jounrney to make now from blue to yellow to "red", and a lot of effort to be put to do that. Hoping to perform well in the coming SRMs.
I always liked programming back from my school days, but never got a platform where I could develope my coding skills, until I came to NIT Dgp.
I came to know about two platforms where I could develope my coding skills, http://topcoder.com and http://spoj.pl . The first year passed by without me being much involved in programming, apart from participating in junior codecracker organised by Linux Users' Group of my college.
In the winter break I took programming seriously and started participating in Topcoder. Initially in the SRMs I did not perform well, many a times I cracked the logic but due to some bug in my code it failed the system tests. It was a very slow start.
I participated in 15 SRMs in Topcoder and made my journey from grey to green. Then it was the 16th SRM in which I gave my best performance I was ranked 28th overall in div-2 and advanced to div-1. So the journey was from grey to green to blue. It feels good to be blue for the first time and be in div-1.
Theres a long and tough jounrney to make now from blue to yellow to "red", and a lot of effort to be put to do that. Hoping to perform well in the coming SRMs.
Subscribe to:
Posts (Atom)