ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1003. Parity

1003
Posted by Ethan 1 Apr 2004 21:02
I can't success the Test 1.
Who can help me?
Re: 1003
Posted by buggzy 1 Apr 2004 21:43
Consider point set generated by segments. For example, segments 1-2 and 3-4 generates set of thee points.

Each point should have attribute "parity" with such property: if one point can be reached from another then its parity should be equal.

This model provides criteria of "compatiblity" of the segments set. I have implemented O(n*n) algorithm for this task. You can find some other details about my algorithm at this board.

Maybe Yakovlev have another model? ;)

Edited by author 01.04.2004 21:46
Re: 1003
Posted by Vladimir Yakovlev (USU) 2 Apr 2004 01:24
I used the same idea, but my new solution is O(n*log(n)) and worked 0.078 sec.