How To Solve Informatics Olympiad?

How can I solve these problems of INOI 2013?

  • http://www.iarcs.org.in/inoi/2013/inoi2013/inoi2013-qpaper.pdf This is the link. INOI stands for Indian national Olympiad informatics. It is national round of IOI. Please provide solutions to these problems ( algorithm or syntax in c++ or syntax in c).  if you're lazy, provide hints that could be helpful. I have tried a lot and I am unable to solve these problems.

  • Answer:

    Question 1 : Try dynamic programming, only for the backward phase, and then for the entire game. First for each i, calculate the maximum score one can get by playing the backward phase starting at i. Then for each i, calculate the maximum score one can get by playing the game (forward+backward) starting at i. Question 2 : You can divide this into two parts : first, for every pair of people, determine if they are each other's relatives. Having done this, you can use this information and forget about ids to determine the size of the President's extended family. For the first part, note that only the set of numbers in each person's id matters, not the order. This suggests that it might help to keep each id sorted, and indeed it does. Once you have sorted each person's id, you can check if two ids have at least K elements in common by doing a simultaneous linear scan on both. For the second part, you have a graph with people as vertices and being related as the edge relation. You have to find the size of the component with the President, which can be done by standard techniques such as breadth-first search and depth-first search. Look up online resources for more on dynamic programming and graph algorithms, such as http://www.iarcs.org.in/inoi/online-study-material/ and http://www.topcoder.com/tc?d1=tutorials&d2=alg_index&module=Static.

Prateek Karandikar at Quora Visit the source

Was this solution helpful to you?

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.