TooNewbie's blog

By TooNewbie, 8 years ago, In English

There are N chords on circle. We know chords start degree and end degree. Find how many parts circle divided. Start of the coordinate system is located in center of the circle. 3 chords don't intersect at one point. Note: I made algorithm for that problem, but i couldn't write what i want. My algorithm: ans=n+1+(count of intersects of chords with each other). See image from link below. http://codeforces.me/predownloaded/83/53/83534d0e0c3e1c27cf0fb769066847d61e0660a1.png

  • Vote: I like it
  • +5
  • Vote: I do not like it

»
8 years ago, # |
  Vote: I like it +5 Vote: I do not like it

Do you have a link to the problem please?

»
8 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Can anyone help me to do this with my algo? Or you can post your own solution. Any idea???

»
8 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Any idea?