# | User | Rating |
---|---|---|

1 | tourist | 3697 |

2 | Benq | 3583 |

3 | Petr | 3522 |

4 | ecnerwala | 3467 |

5 | Radewoosh | 3466 |

6 | maroonrk | 3369 |

7 | Um_nik | 3358 |

8 | jiangly | 3330 |

9 | Miracle03 | 3314 |

10 | scott_wu | 3313 |

# | User | Contrib. |
---|---|---|

1 | 1-gon | 214 |

2 | Errichto | 189 |

3 | awoo | 188 |

4 | rng_58 | 187 |

5 | SecondThread | 186 |

6 | Um_nik | 179 |

7 | Ashishgup | 177 |

8 | maroonrk | 172 |

8 | vovuh | 172 |

8 | antontrygubO_o | 172 |

↑

↓

Codeforces (c) Copyright 2010-2021 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Apr/17/2021 01:34:31 (g2).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|

Common case with Topcoder website :(

It seems to be in the calendar here, link.

The email reminder says it will be at 12:00 UTC-4, that is 19:00 MSK (why don't they put a link to timeanddate in their email?).

Very nice problems, 600 was very nice and 900 also looked interesting.

Any ideas on 600?

900 can be solved using 2-SAT on variables "i-th person in subtree of j-th vertex". There are some condition on this variables depended on tree structure, like, if you are in subtree of vertex, you are in subtree of it's parent. I lost condition, that you can't be in subtrees of two vertices wich are different sons of one, so failed systest.

Each of problem conditions can be expressed in terms of "both vertex in subtree of x[i], and at least one of vertices not in subtree of each son of x[i]". This changes a bit if r[i] is son of x[i]. But all subtrees for all roots are subtrees or their complements of original tree, so it's ok.

Let

Nbe the number of points. We can see that (the number of finite regions) = (the number of crossings) + (the number of components) —N. Since the number of components is a constant (unless we make really stupid choice of directions), we want to maximize the number of crossings.Now, let's convert the coordinates, and assume the following:

N, and of the form "integer + 0.5".We want to color the points red and blue, and maximize the number of pairs of red point

Rand blue pointBsuch thatx(R) <x(B) andy(R) >y(B).Here, in one optimal solution, we can prove that their is a shortest path from (0, 0) to (

N,N) that splits the square [0,N] × [0,N] into two regions, such that in one region all points are red and in the other region all points are blue. Now it's not hard to come up with anO(N^{2}) DP.Am I right the solution for 900 is the 2-SAT on statements "person

xlives in the subtree of directed edgey"? I've coded this, but haven't managed to get it working in time.Ok, thanks PavelKunyavskiy :)