Showing posts with label topcoder. Show all posts
Showing posts with label topcoder. Show all posts

Sunday, 7 September 2014

Another amazing week !

These days I am learning concepts related to number theory . As said by C.F. Gauss "Mathematics is the queen of sciences and number theory is the queen of mathematics" I learned a lot this week some of the things which I learned includes Fermat's Primality Test,Goldbach's conjecture, finding primitive root of a prime,etc,.

This week I participated in Topcoder SRM also and solved 2 problems out of three . In the beginning of the contest I was messing with the 250 pt problems and I took a lot of time to get it correct I was at the 18 or 19 th position in my room of around 25-30 contestants but I solved the 2nd problem slightly fast and ended up with 7th position and added some positive points in my rating :) .

Thanks for reading . 

Sunday, 31 August 2014

One more great week !

This week was very good in terms of my ratings in the various online contests. 

For the first time I solved 3 Div 2 problems in a codeforces round and now I am at my all time highest rating of 1457 . I solved a question in SRM also and now my rating is above my past 4 months record . 
We solved 1 question in TCS codevita too .  
Today I solved a problem in Codechef's Lunchtime too.

This weekend I was developing a GUI in python using tkinter . I made a simple quiz with some options as buttons on it .Clicking on the buttons displays comment(Label) on your selection in a funny manner . I'll add some more features to it in the coming weeks .  

We are planning to take part in ICPC online rounds as the first team from our college . Lets see what we'll be able to do . 

Thanks for reading . 

Sunday, 17 August 2014

Nice week

This week was very informative and a good one as I learned a lot .
I participated in TCS's Codevita contest with my friend and we solved 2/7 questions . We should have solved at least 4 but somehow due to lack of coordination among us(this was our first ever team contest) we could solve just 2 .

I solved 2 question in Codeforces weekly contest and now I am again a 'specialist' after a long time .(I know I am not :P )

I successfully solved Div 2 250 for 212 points in this week's SRM on TC and now my rating is 480 in 10 contests . I know its not good but still better than before .

This week I learned the implementation of Longest Common Subsequence and Longest Increasing Subsequence .

Thanks for reading and keep coding ! 

Monday, 4 August 2014

Practice Session

So, once again I am shifting to TopCoder to hone my programming skills .This time I am doing Div 2 500 problems . I am forming a team to apply for ICPC regionals . First ,we need to qualify for the onsite regional contest and if we are able to do that it will be great as we are just in our 2nd year and with very less experience in programming . Lets see what happens.

This week I was doing random problems and participated in Codechef's Long contest which is still going on . I've already done 2 problems in the contest .I am participating in Codevita also which will be conducted on Aug. 12.
I've written a C++ program for BFS and will try to apply it on some graph problems .  

Thanks for reading . 

Thursday, 19 June 2014

Time for some Maths...

We lost humblefool this week in a car accident , he was a great coder(The first Indian who became red on Topcoder) he was excellent at coding and a nice person as well .It hurts a lot when a great person dies may God rest his soul in peace.

This week I was increasing my mathematical knowledge . Learnt many concepts regarding game theory especially Nim game after going through the rules of the game I came up with my own style to solve the game for ex - this game is played between two players A & B . On each turn the person will subtract a number given in the set lets say S = {1,4,5} from a given number N until we get a Zero the person which will not be able to subtract from the no. he gets will be the loser . N will be our starting number from which we will subtract 1,4 or 5 so that the player subtracting will win. Like every other player both A & B will try thier best to win this game so they will play optimally .'Optimally' in the sense that they will try some maths in their head to come up with the best solution i,e. to subtract which no. so they will win .

I came up with an idea like lets create a function for this game

 P(N)
 {
     if (N =1 or N=4 or N=5) return 1(denoting win with 1)
    else if(N=0 or N=2) return 0 (denoting loss with 0)
    else return ( P(N-1) or P(N-4) or P(N-5) )
 }

As we can clearly see if a person gets 1,4 or 5 he can directly subtract 1,4 or 5 from the no. he gets to arrive at zero and thus the other player won't be able to subtract any no. from a zero.
so in first if statement 1,4 and 5 are returning a WIN

for N=0 the first player won't be able to subtract any number so he will lose .For N=2 we can see that the person will be left with only one choice i.e. to subtract 1 from it so the 2nd player will arrive at N-1=1 so he will also subtract 1 from it thus arriving at Zero so that will be a loss for the first player so we return LOSS on 0 and 2

For rest no. I am taking OR from all the possibilities of subtracting 1,4,5 because if we get a 1 from any of these possibilities this will mean that the player will choose the winning move (Well that is the meaning of playing optimally).

So this function will give us the right result for this game.
We can optimize our function by memoizing our results using an array like we do in top up approach of Dynamic Programming ... that will save us a lot of time ..

Today morning I understood how to implement the Sieve of Erastonethes.That was amazing algorithm .
It was efficient O(NloglogN) as well as simple by logic Enjoyed implementing it.
I'll be increasing my maths knowledge as maths skills are very handy while programming.They can simplify one's code to a very large extent thus one just can't ignore maths while coding.

Thanks for reading. 

Thursday, 12 June 2014

Couldn't stop to participate

Earlier I was thinking that I will not participate in any kind of competitions but I couldn't stop myself ....
Participated in the SRM 624 and guess what ? I submitted 2 div2 problems successfully a 250 & a 500 finishing at 8th place in my room 'my current best' previous best was 10th . Got 246 odd pts from the 250 pointer I think this is my best till now. 
The problems were very easy in this SRM that's why I could solve them(This is the truth).

I participated in Codechef's June Long contest also and solved 2 problems for the first time in a long contest.
So, definitely I am improving day by day I should not give practicing because practice is the key to get better at almost everything and coding competitions are no different. 



Friday, 6 June 2014

Learning how to climb

I am still practicing Div2 250 problems and when I get tired or frustated (when I stuck at some prob. for long) I start doing problems from other online judges like SPOJ,Codechef.

On Topcoder I am stuck at string problems like how to extract integer values from the given string
In some questions we are given string vectors and we need to manipulate the integer values like summing all the integers or some calculations involving them . I've found a way to deal with them . I am using c_str() and sscanf() functions but I am in a search of better technique to deal with them .

By the way, My college is at 11th page of institutions rankings on SPOJ currently ranked at 1042 . I want it to be in top 100 at least and for that to happen I need help from all my fellow batch mates and juniors. I hope one day we will be in top 100 . Currently I am ranked at 9903 worldwide on SPOJ .

Still practicing more and more problems ... A long way to go from now.... The journey has just begun ;)

Sunday, 25 May 2014

Learning the hard way

So, now I've decided to push my coding skills to a new level. This week I was solving Div 2 250 problems on Topcoder . On an average I am doing 3-4 problems on it spending around 30-60 minutes on each of them trying to understand them and coding them.If I get stuck at something I am reading the editorials of the problem to further check my solution or to get new ways to do the same problem.This not only improves my coding skills but gives me a different approach to do the same question also.As of now I am not participating in SRMs and Codeforces contests  because I want to first sharpen my axe for a good amount of time and then cut the tree smoothly rather than cutting the tree with the blunt axe .

I am learning C++ these days.Its good to go with C++ when you have C basics with you.

Also this week I participated in Codechef's short contest and  managed to solve 2 problems . This was the first time when I could solve more than 1 problem on their contests and now I am ranked 1226 worldwide and 721 in my country in short contests.

I am certainly improving day by day . I can see that improvement as now I can think much more faster on how to solve a particular solution and I will continue to practice more and more..