Showing posts with label acm icpc. Show all posts
Showing posts with label acm icpc. Show all posts

Saturday, 1 November 2014

ICPC Drama

This time it was better.A lot better than before . I am talking about ICPC Kharagpur regionals.

We missed the original contest which was scheduled on Oct 18 due to our negligence but god gave us another chance and we took it .

We were having our lab during the contest hours and we decided to leave the lab 1 hour before to participate in the contest. Everything went well and we reached our hostel well before time.

I was having headache that day but still I wanted to help my team every possible way. I decided to give my 100%.

I went to Sudharsan's room around 10 minutes before the starting of the contest . He was having butterfly in his stomach . He was waiting for this contest desperately.

The clock ticked 6 and contest started. I opened a problem and found out that it was very easy.Without wasting time I started coding it meanwhile my friends opened different problems by the time I was debugging my code Sudharsan asked me if he should code my problem I said yes to him but I didn't stop coding and made the program before him . Then I called him to give some test cases and then submit . He gave around 15-20 test cases and it was working fine and we decided to submit it but there was a problem . I was logged out due to some reason and we were getting error "Access denied" it was so much frustrating.
Then I coded the same solution on his laptop to submit. I got compilation error due to mishandling the variable names (I used the same names I used in my original program :P ) This whole process costed us 10 more minutes but we got AC without any penalty. 

By this time we were 2nd in our college as the other team submitted the solution just 20 seconds before us.

Meanwhile Prajval (cool dude) came up with a solution to the second problem. We were so happy but I saw a basic flaw in the program I made a test case where his code was failing.We concluded that this problem is based on graphs . Sudharsan was practicing graphs specifically so he took the responsibility to code it . Meanwhile I was making test cases where our code may fail. After 50 minutes we were ready for our second submission. 

We got AC in our first go and that sealed our way to the Kharagpur regional.
We were ranked 126/440 teams and 43 out of 100 teams they have selected for the onsite.

We are now planning to go for Kharagpur regional . The onsite contest is on Dec 7 . Lets see what happens in the real arena. 

Sunday, 26 October 2014

Something Unimaginable !

Though I'm late but still I won't stop myself.Wishing everyone a very happy and prosperous diwali .

This is the first time I was participating in ACM ICPC regionals and we got selected for one but the sad part is that we got selected just because of the rules of the competition .

According to the rules of the competition - Firstly, those teams will be selected which have solved at least 1 question and are first from their college,if slots are left then teams will be selected from the rank list according to the merit.

As you can see that it may happen that from a college where many good programmers are participating a highly potential team may not get entry to the regional while a not so good team may get it easily.

Let me show you an example - Suppose there are two colleges X,Y

X is a very big and renowned college and has around 50 good programmers .

Y is not so big college and doesn't have programmers at par with X .Lets say somehow, Y comes up with 1 team.

In the contest around 7 teams from X solve 2/5 problems , 8 teams solve 3/5 problems and 2 teams solve 4/5 problems .

On the other hand team from Y manage to solve 1/5 'the easiest of all problem' and gets rank 1 in their college.

So, according to the rules it may happen that the teams which solved 3/5 problems don't get selected as they are not the best in their college but as Y's team was the best in their college it will get entry to the regional. Sounds unfair right ?!

That's what happens every year in the Olympics of programming ACM ICPC .

 Nevertheless , we got selected and we should try our best to prove our selection right. 

We missed Kharagpur online contest.It was scheduled at 2 to 5 PM and due to our negligence we thought that it is at 6 to 9 PM because for Amritapuri regional it was from 6 to 9 PM .
I came to know about this at around 5:45 and we were dumbstruck. This was one of the biggest mistake we would have ever done but I told my teammates not to worry about anything we still have Amritapuri and we will give our best there.

Surprisingly on Diwali day I got a surprise that due to some reasons they are re conducting the contest on Oct 30 and luckily, very luckily we got another chance for the contest. This time we won't make any mistake .

This week I solved problems from SPOJ and participated in codeforces round also . After a very long time I again participated in the online contest on codeforces and stood 1285 from around 2000 contestants . 

Question: Is it time to change the selection procedure ICPC regionals ? Leave your comments below .

Tuesday, 21 October 2014

ACM !

So, its official now . My team got selected for ICPC onsite regional of Amritapuri !

Though, our performance was very bad but we got selected as we were the best team in our college.
We would like to make a mark in our first ever regional . Lets see what happens in the coding arena .

These days I'm learning and coding as much as I can . Expanding my armory with new techniques ranging from geometry to DP ,from bits to graphs.

After a long time I participated in a timed contest on codechef and stood 852 out of around 2500 contestants . Not one of my best but still good enough for a start after a very long time .

Yesterday I solved a question based on breadth first search and it felt so great after solving that as it was my first bfs problem . I was waiting for this for a long time .

Thanks for reading and keep coding !

Sunday, 5 October 2014

Gaining the momentum

This week I was revising my previously learned algorithms/theorems . This includes sieve of Eratosthenes,Game theory,modular exponentiation,etc,.

Its time to increase my knowledge base . These days instead of participating in online contests(other than ACM related) I'll be only learning new things and posting about them in detail in my coming posts . So, stay tuned for some amazing stuff coming shortly ;)

I was also trying my hands on application development . I am learning to make a simple calculator using C++ .

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 . 

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 . 

Saturday, 28 June 2014

SPOJ Fever

ACM ICPC 2014-This year problems were hard as many good teams could solve only 3-4 problems. This time IIT Indore (A new IIT) secured the first place among Indian Colleges beating big colleges like IIIT Hyd,IIT Bombay,IIT Madras,IIT Roorkee . Congratulations to all the teams after all going for ICPC World Finals is in itself a big achievement .

This week I was a little busy in answering the queries of some curious souls who just now cleared JEE and about to join the premier institutes of the country, it always feels good to guide someone who is asking for your opinion.I always advise people to opt for that stream/branch in which they have interest .

 I took a break from my Topcoder practice and started SPOJ problems . For the first time I successfully applied a top down Dynamic Programming approach in 1 question . I was waiting for this moment for past 2/3 months . It feels very good after seeing a problem solved after so many unsuccessful attempts .

Sieve of Eratosthenes - 

I learnt how to apply Sieve of Eratosthenes. This method is very fast(for numbers of the order of some millions) to find whether a  given no. is prime or not . The approach is simple, suppose we have a no. N we want to find whether this no. is prime or not we just need to look at all the primes <=Square root(N) lets say we want to know whether 431 is prime or not so we need
  Sqrt(431) ~20.7 we just need to check whether primes <20 i.e. 2,3,5,7,11,13,17,19 can divide this no. or not .
So, 431 is an odd no. so not div by 2
sum of digits is 8 so not div by 3
end digit is 1 so not div by 5
431%7!=0 , 431%11!=0,431%13!=0,431%17!=0 and 431%19!=0 . Ohh! I took a random no. and it was a prime! I need to find the probability of finding a prime no. randomly from the set of natural no. :P Just kidding :D . Recently, I found out that this probability is inversely proportional to the logarithm of the chosen number N .

So this is how Sieve works and if you know all the prime less than sqrt(N) then this method is very fast .

Thanks for reading and keep coding .