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
Related Q & A:
- In Visual Studio 2012 or 2013, how can I register a DLL file on Windows 7 64-bit computer using a Custom Action command?Best solution by Stack Overflow
- How do I solve the problem of downloading word document attached to my email?Best solution by support.google.com
- How can I get help with my converter box problems?Best solution by Yahoo! Answers
- How do I solve a DNS error?Best solution by Yahoo! Answers
- How do I solve the coin problem?Best solution by Quora
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
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.