An algorithm for the optimal "intersection" of two results?

I have two results and I would like to get a better "order" of both of these. Example:

We have a race with 5 people in one race and 7 in another. The result is: Race 1.

1. Karl
2. Fred
3. John
4. Peter
5. Sid

Race 2.

1. Steven
2. John
3. Karl
4. Peter
5. Aron
6. Fred
7. Kevin

Questin: what are the first 7 of these races?

It is obvious that in this case nr 1 is Karl, since he takes one place and third, which is better than John’s second and third place. Nevertheless, Stephen could be equally good, but he participated in only one race and had to suffer some kind of punishment for it.

What are the known algorithms for this problem? Are there trivial solutions? I just can't figure it out

+3
source share
3 answers

( ) , 1- 20. 18. 3- 16 ..
-5. .

, .

, .

+2
+1

- - . , , , "". , , BIG_VAL (, 100). "". , . . , , BIG_VAL . , , , - . 4, 5, 8 .. :

http://bit.ly/fvYtal

0
source

Source: https://habr.com/ru/post/1787142/


All Articles