There's a problem from programming competition which already finished: http://codeforces.com/contest/458/problem/F
Two weeks already passed but still nobody solved it yet - in fact you can see here http://codeforces.com/problemset?order=BY_SOLVED_ASC that this is the only problem in the set of about 2000 problems that was not solved yet.
The problem itself follows.
Pieguy and Piegirl are playing a game. They have a rooted binary tree, that has a property that each node is either a leaf or has exactly two children. Each leaf has a number associated with it. On his/her turn a player can choose any two leafs that share their immediate parent, remove them, and associate either of their values with their parent, that now became a leaf (the player decides which of the two values to associate). The game ends when only one node (the one that was the root of the tree) is left. Pieguy goes first, and his goal is to maximize the value that will be associated with the root when the game ends. Piegirl wants to minimize that value. Assuming that both players are playing optimally, what number will be associated with the root when the game ends?
Can you help me how to mathematically solve this minimax problem? Do we need to use any advanced concepts from game theory to solve this problem?
Thank you for the help in advance.